fix(profiler): resolve local PVC model path for AIC calls - #9877
Conversation
rapid.py and thorough.py passed the raw HF model id to AIC even when modelCache provided a mounted PVC with local weights. Route all four AIC call sites through resolve_model_path() so locally-mounted weights are used instead of re-fetching from HuggingFace Signed-off-by: jooe0824 <jooe0824@sk.com>
|
👋 Hi jooe0824! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughIntegrates resolve_model_path() into RAPID and THOROUGH profiling flows so model identifiers are resolved to local PVC paths when present (else HF IDs). Adds comprehensive unit tests that validate resolve_model_path() behavior and its propagation into rapid and thorough call sites. ChangesModel path resolution across profiling
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
✅ Actions performedFull review triggered. |
Address PR review on the resolve_model_path change :
- _generate_dgd_from_pick now resets ServiceConfig.model_path :
served_model_path to dgdr.model before DGD generation, so a resolved local PVC path is not used as the deployment's served model name.
- resolve_model_path now requires config.json in the PVC directory before returning the local path; otherwise it falls back to the HF id.
Add tests for both fixes.
Signed-off-by: jooe0824 <jooe0824@sk.com>
…thub.com/jooe0824/dynamo into jooe0824/fix-profiler-resolve-model-path
|
/ok to test bd7cfc0 |
…9877) Signed-off-by: jooe0824 <jooe0824@sk.com> Co-authored-by: jooe0824 <jooe0824@sk.com> Signed-off-by: Chi Xing <cxing@nvidia.com>
|
Thanks for reviewing my PR! 😄 Production change is ~12 lines, rest is regression tests. Would appreciate a review when you get a chance — thanks! |
|
👍 @hhzhang16 I also opened another PR as a follow-up in the same profiling area: Would appreciate a review when you get a chance - thanks! |
rapid.py and thorough.py passed the raw HF model id to AIC even when modelCache provided a mounted PVC with local weights. Route all four AIC call sites through resolve_model_path() so locally-mounted weights are used instead of re-fetching from HuggingFace
Overview:
The profiler's resolve_model_path() helper
components/src/dynamo/profiler/utils/profile_common.pywas added to prefer a locally-mounted PVC model path over the HuggingFace model id when feeding model_path to aiconfigurator. It was wired into profile_sla.py only — four other call sites in thorough.py and rapid.py still passed the raw dgdr.model (the HF id), so aiconfigurator fetched config.json from huggingface.co even when the weights were already mounted in the profiler pod via modelCache.Details:
resolve_model_path(dgdr) returns the local directory when modelCache resolves to a real directory, and falls back to dgdr.model.
Four call sites changed — each
model_path=modelbecomesmodel_path=resolve_model_path(dgdr):thorough.pyrun_thorough(Stage 1, enumeration)enumerate_profiling_configs(model_path=…)thorough.pyrun_thorough(Stage 4, DGD generation)TaskConfig(model_path=…)rapid.py_run_autoscale_simTaskConfig(model_path=…)rapid.py_run_default_simbuild_default_task_configs(model_path=…)Scope of the failure
The profiler passes the raw HF id, AIC issues a huggingface.co GET for config.json for any model that is neither a local directory nor in AIC's bundled DefaultHFModels set.
With this fix, when modelCache resolves to a real directory aiconfigurator reads config.json from disk — no huggingface.co request.
Test:
Add components/src/dynamo/profiler/tests/unit/test_resolve_model_path.py — 16 unit tests
Where should the reviewer start?
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
Bug Fixes
Tests