Repository navigation
fix: avoid spatial initialization during memory queries - #50
Conversation
Resolve the per-device memory quota without applying compute budgets. Preserve native memory query errors when no device has been selected. Signed-off-by: maverick123123 <yuming.wu@dynamia.ai>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maverick-woo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Validate and resolve memory queries crates/hook/src/hook.rs |
The hook validates requested limits and preserves the spatial guard. It returns HBM information when the current logical device has HBM limits enabled; other cases use the native runtime passthrough. The unused npu_limiter import was removed. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related issues
- Issue 42 describes the spatial-budget initialization order. This change preserves the spatial guard in the memory-query path.
- Issue 45 describes per-NPU memory accounting. This change uses the current logical device when checking for HBM limits.
Possibly related PRs
- Project-HAMi/hami-vnpu-core#47: Adds the per-device limiter and the existing
rtMemGetInfoExpath that this change revises. - Project-HAMi/hami-vnpu-core#48: Adds the vNPU configuration check and requested-limit validation used by this change.
- Project-HAMi/hami-vnpu-core#30: Defines per-physical-card HBM accounting used by the device-specific memory query.
Suggested reviewers: archlitchi, xiguapi-h
Merge Risk: 
Minimal · up to 2ee32
-
The change avoids early spatial initialization during memory queries. No merge-blocking risk remains.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the limits first
Then finds the device for the query
HBM details come when limits apply
The native path stays close at hand
Soft paws hop past the spatial guard
|
/approved |
Keep memory queries from initializing spatial compute budgets before the runtime device is ready, fixing early vLLM startup failures on 310P.
Validated with vLLM OPT-125m on 310P: fresh main reproduces the failure; the fix passes single-container and shared-card two-Pod tests.
Follow-up to #40.
Summary by CodeRabbit