-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make materialize_batch
extendable without piracy
#18
Comments
The extension approach so far has been focused on dispatching on the fields of the batch item (e.g. the
is there a downside to using
this one is harder, and I think your idea of wrapping the output of |
For I also would like to pass an RNG through |
IMO the Right Way to handle the augmentation threading is in a "channel selector" type that "freezes" the RNG state/augmentation parameters at |
I guess whether that's an issue will depend on whether the julia scheduler will switch to another task while teh C call is happening. |
I think it also depends how well global state etc is managed in the C lib. Bc even if Julia doesn’t task switch at ccall, it could in-between setup and execution calls (if there are, I haven’t looked into it). Hopefully it would be ok. |
* WIP copy paste * disturbuted * update tests/src * actually, you know, run the tests * export * not actually required for tests and increases compile times * need to wait... * update docstrings * api docs * constructor docstring too * Update src/batch_services.jl Co-authored-by: Eric Hanson <[email protected]> * Update src/batch_services.jl Co-authored-by: Eric Hanson <[email protected]> * fix docstring * rmprocs, refactor retry, finalize channel on stop * actually fix * graceful error handling in status, tests * still test on 1.7 since we declare compat * missed test update * more edge case tests Co-authored-by: Eric Hanson <[email protected]>
It would be nice to be able to extend it, in case e.g. something else needs to happen when collecting individual batch items for a particular type of Batcher or BatchItem. I think the issue is now we have a table instead of a single item, so we can't just dispatch off the item type. One option is allowing users to pass a singleton type to use for dispatch which gets passed around, or something like that.
In my case, I have 2 needs that the current method doesn't do:
map
instead ofasyncmap
since mymaterialize_batch_item
is doing a bit more work and it's not IO bound (I think)Array
s yet but rather aVector{Samples}
and an array, since I still want the samples wrapper for a bit longer. [This part I could avoid by refactoring to move more work into this portion since I do need a raw array in the end, but it would be nice to be able to do that more incrementally without piracy]edit: also realized
materialize_batch_item
tends to need piracy too, since it comes in as aNamedTuple
, not aBatchItem
(or such) object, at least w the Legolas v0.4 branchThe text was updated successfully, but these errors were encountered: