Background
PR #264 added the DSV4 NPU async CAM/ubatching path. A few tactical workarounds and duplicated flows were intentionally left for follow-up so that their runtime contracts can be validated separately.
Related: #264 and #150.
Follow-up tasks
Validation
- Cover buffer lifetime and ordering after removing the synchronization, including multiple layers/stages and repeated in-flight work.
- Verify model resolution in spawned workers after removing the direct
register_afd() call.
- Test the supported multiprocessing methods on the affected Python/CANN/CAM environment and document the result.
- Keep existing DSV2 and DSV4 async CAM unit/E2E behavior unchanged after refactoring.
Acceptance criteria
- No device-wide synchronization remains in the DSV4 connector-driven FFN steady-state path unless a demonstrated external CAM contract requires it.
- Model-config conversion no longer invokes
register_afd() directly.
- The
spawn requirement is either removed or backed by a reproducible, narrowly scoped runtime contract without a package-import-time global multiprocessing monkey patch.
- Any shared DSV2/DSV4 abstraction reduces real duplication and preserves explicit model-specific differences.
Before submitting
Background
PR #264 added the DSV4 NPU async CAM/ubatching path. A few tactical workarounds and duplicated flows were intentionally left for follow-up so that their runtime contracts can be validated separately.
Related: #264 and #150.
Follow-up tasks
torch.npu.synchronize()from the connector-driven FFN path. Replace it with the narrow completion/credit mechanism required to keep CAM buffers alive and prevent premature reuse. Coordinate this with the shared stream-pipeline work in [Feature]: Add CAMAsync multi-stream execution on a shared NPU stream pipeline #150.register_afd()call fromget_afd_model_config(). Model registration should be established through the appropriate plugin or worker initialization path rather than as a side effect of model-config conversion.spawn. Provide a minimal reproducer and identify which component depends on it. If it is not required, removeAFD_FORCE_SPAWN_MULTIPROCESSINGand the process-wide multiprocessing override. If it is required, isolate it to the affected NPU runtime/launcher path and avoid modifying Python's global/private multiprocessing context from package import.Validation
register_afd()call.Acceptance criteria
register_afd()directly.spawnrequirement is either removed or backed by a reproducible, narrowly scoped runtime contract without a package-import-time global multiprocessing monkey patch.Before submitting