fix: preserve system IDs during inflight refill#113
Conversation
Signed-off-by: architd <architd@nvidia.com>
Greptile SummaryThis PR fixes a bug where sampler-assigned
Important Files Changed
Reviews (4): Last reviewed commit: "test: cover refill with complex status b..." | Re-trigger Greptile |
Signed-off-by: architd <architd@nvidia.com>
There was a problem hiding this comment.
Could you add another test case where not all samples are graduating?
Essentially, we want to make sure that the refill case where only some slots are being replaced that the system ids are also being preserved then
There was a problem hiding this comment.
Thanks, I believe that this case is covered in the latest commit (dbcef64) by test_refill_preserves_mixed_system_ids.
That test starts with initial system_ids [0, 1], marks only the first sample as graduated with status = [[1], [0]], then verifies the refill result preserves the remaining system ID and the replacement ID as [1, 2].
Please let me know if you have a different partial-refill scenario in mind.
There was a problem hiding this comment.
Basically we only cover the case where the exit and entry status codes are the default cases; you could add one or two unit test cases to make sure that this is working as intended when they're not the default 0 and 1 values
There was a problem hiding this comment.
Thanks for the clarification. I added a new commit, 4e7d30a (test: cover refill with complex status bookkeeping), with three additional refill regression tests that cover the non-default / more complex status cases you pointed out.
The new tests cover:
-
test_refill_preserves_system_ids_with_multistage_statuses: a multistage case with statuses[0, 1, 2]andexit_status=2(as opposed to the standard 1), where only the status-2 system graduates. This verifies the remaining lower-status systems keep theirsystem_ids while the replacement gets the next sampler-assigned ID. -
test_refill_preserves_system_ids_with_multiple_replacements: a case where two systems graduate in the same refill call. This verifies that the remaining system keeps its ID and both replacement systems keep their newly assigned sampler IDs. -
test_refill_preserves_replacement_status_from_dataset: a case where replacement samples already carry nonzero graph-level status from the dataset; i.e., non-standard entry-points. This verifies thatrefill_check()preserves bookkeeping already present on appended replacement samples instead of forcing replacement status back to the default.
Together these should cover partial refill with non-default/multistage statuses, simultaneous replacements, and replacement-carried bookkeeping values.
|
/ok to test f7b0128 |
Add refill coverage for a multistage-like status case where only the status-2 system is replaced while lower-status systems keep their IDs. Add coverage for simultaneous replacement of multiple graduated systems, preserving the remaining system ID and assigning new sampler IDs to both replacements. Add coverage for replacement-carried bookkeeping by verifying a dataset-provided nonzero status survives refill. Signed-off-by: architd <architd@nvidia.com>
|
/ok to test 4e7d30a |
Description
Preserve sampler-assigned
system_idvalues for replacement systems during inflight refill.BaseDynamics.refill_check()now seeds rebuilt bookkeeping tensors from values already present on the appended result batch before restoring values for systems that stayed active.Type of Change
Related Issues
Fixes #112
Changes Made
refill_check()for inflight batching.Testing
uv run pytest test/dynamics/test_inflight.py::TestRefillCheck)make lint)system_idpreservation during inflight refill.Checklist
Additional Notes
This is a Python-only toolkit fix. No
nvalchemi-toolkit-opschanges are required.