Uh oh!
There was an error while loading. Please reload this page.
fix(engine): resolve inference workspace attribute lookup - #8288
Conversation
Signed-off-by: nathon-lee <leejianwoo@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:49dc3e9372
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
delock
commented
Aug 22, 2026
Hi @nathon-lee thanks for the fix. I have one comments hope you can followup. Thanks! |
Signed-off-by: nathon-lee <leejianwoo@gmail.com>
nathon-lee
commented
Aug 23, 2026
Hi @delock, thanks for the review. I have addressed the requested change and strengthened the regression test to verify the exact AttributeError message. The update has been pushed and is ready for another look. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
Fix recursive attribute lookup in
DeepSpeedEngine.__getattr__.WorkspaceOpinherits fromtorch.nn.Module, so assigning it toDeepSpeedHybridEngine.workspaceregisters it in the engine's_modulesmapping. The existing
DeepSpeedEngine.__getattr__implementation did notdelegate to
torch.nn.Module.__getattr__before forwarding missing attributesto the wrapped model.
When HybridEngine was configured with:
the first call to
retake_inference_cache()attempted to accessself.workspace. The registered submodule was not resolved correctly, and thefollowing logic recursively invoked
DeepSpeedEngine.__getattr__:This eventually failed with:
The updated implementation first uses the parent
torch.nn.Moduleattributeresolver. It delegates to the wrapped model only when the attribute is not an
engine parameter, buffer, or registered submodule.
Changes
torch.nn.Module.__getattr__.AttributeErrorbehavior for missing attributes.Testing
Unit tests
Result:
The warnings only reported that explicit expected Torch and CUDA versions were
not provided to the test runner.
HybridEngine integration validation
The fix was also validated through the real HybridEngine
release_inference_cache=Truepath using the OPSD profiling benchmark relatedto #8197.
Test environment:
facebook/opt-6.7bcuda:0CUDA_LAUNCH_BLOCKING=1Before this fix, the first rollout failed in
retake_inference_cache()with a recursive__getattr__traceback.After this fix, the benchmark completed successfully and produced:
The corresponding cache-retaining baseline was:
For this workload, the complete cache release/retake lifecycle increased mean
rollout latency by approximately 132.98 ms, or 2.56%, and reduced aggregate
throughput by approximately 2.50%.
These measurements are included as integration validation rather than a
cross-hardware performance claim.
Scope
This PR fixes engine attribute lookup and restores the HybridEngine inference
workspace release/retake path.
It does not:
Related to #8197.