perf(evaluator): lazy load values module - #1162
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe evaluator SDK now defers public API and optional dependency imports. It adds bounded ChangesEvaluator SDK closure
Sequence Diagram(s)sequenceDiagram
participant CI
participant ChangesAction
participant SmokeJob
participant EvaluatorSDK
participant LazyAPITest
CI->>ChangesAction: evaluate evaluator SDK closure paths
ChangesAction-->>CI: expose evaluator-sdk-closure
CI->>SmokeJob: start package-only smoke job
SmokeJob->>EvaluatorSDK: install without extras or workspace packages
SmokeJob->>LazyAPITest: run lazy public API test
LazyAPITest->>EvaluatorSDK: import and resolve public names
EvaluatorSDK-->>LazyAPITest: return cached public objects
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/actions/changes/action.yaml:
- Around line 92-100: Update the evaluator-sdk-closure paths in the changes
filter to cover the entire nemo_evaluator_sdk source tree, including modules
such as agent_inference.py imported by agent_eval/evaluator.py. Retain the
existing dependency, workflow, and self-coverage entries while replacing the
narrower source-directory patterns with a source-tree-wide match.
In @.github/workflows/ci.yaml:
- Around line 991-995: Update the “Run lazy-import closure unit test under the
stripped install” step to bypass the repository pytest configuration by invoking
pytest with a null config and importlib import mode, while preserving the
existing targeted test path and verbose output.
In `@packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/__init__.py`:
- Around line 13-17: Update the module docstring in the package initializer to
reflect that values/__init__.py is now lazy and that the agent_eval import path
keeps pyarrow, numpy, jinja2, and jsonschema unloaded. Remove the outdated claim
that the values barrel eagerly re-exports names and that AALGO-311 is pending,
while preserving the guarantee for the execution and metric stack.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 38669c09-6ef5-4a9c-a2d3-b8dd29d20f4f
⛔ Files ignored due to path filters (7)
sdk/python/nemo-platform/pyproject.tomlis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/__init__.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_eval/runtimes/docker_sandbox.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_inference.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/values/__init__.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/values/results.pyis excluded by!sdk/**uv.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
.github/actions/changes/action.yaml.github/workflows/ci.yamlpackages/nemo_evaluator_sdk/pyproject.tomlpackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/__init__.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/runtimes/docker_sandbox.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_inference.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/values/__init__.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/values/results.pypackages/nemo_evaluator_sdk/tests/test_lazy_public_api.pypackages/nemo_platform/pyproject.toml
db2fd71 to
1ad8b22
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/nemo_evaluator_sdk/tests/test_lazy_public_api.py`:
- Line 83: Update both subprocess probes in
packages/nemo_evaluator_sdk/tests/test_lazy_public_api.py at lines 83-83 and
137-142 to invoke Python through the frozen uv command, replacing sys.executable
with the uv Python command while preserving the existing probe arguments and
behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 105526e8-8492-4e06-a2c9-c4e5a1543e23
⛔ Files ignored due to path filters (8)
sdk/python/nemo-platform/pyproject.tomlis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/__init__.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_eval/runtimes/docker_sandbox.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_inference.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/metrics/aggregation.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/values/__init__.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/values/results.pyis excluded by!sdk/**uv.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/actions/changes/action.yaml.github/workflows/ci.yamlpackages/nemo_evaluator_sdk/pyproject.tomlpackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/__init__.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/runtimes/docker_sandbox.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_inference.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/metrics/aggregation.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/values/__init__.pypackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/values/results.pypackages/nemo_evaluator_sdk/tests/test_lazy_public_api.pypackages/nemo_platform/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (9)
- packages/nemo_platform/pyproject.toml
- packages/nemo_evaluator_sdk/pyproject.toml
- .github/actions/changes/action.yaml
- .github/workflows/ci.yaml
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/values/results.py
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/runtimes/docker_sandbox.py
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/init.py
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_inference.py
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/values/init.py
|
1ad8b22 to
cecf833
Compare
arpitsardhana
left a comment
There was a problem hiding this comment.
may need to rebase and fix conflicts
7f3ffbf to
3a18f0f
Compare
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
6b4af6b to
98f1403
Compare
Summary
Lazily resolves the evaluator SDK's public and value exports and defers optional imports so the
agent_evalimport path does not load the execution stack or unrelated heavy dependencies. Adds direct dependency declarations and stripped-install CI coverage for the source package and generated SDK mirror.Related Issue
Closes AALGO-311.
Changes
valuesbarrel, mirrored into the generated Python SDK.httpxdependency and update the lockfile/package metadata.Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
uv run --frozen pytest packages/nemo_evaluator_sdk/tests/test_lazy_public_api.py -q— 5 passed.actionlint1.7.12 — passed against all GitHub workflows and actions.git diff --check origin/main...HEAD— passed.uv run pre-commit run -awith uv 0.9.14 first onPATH— all hooks passed, including both lock checks and Studio lint.bash tools/lint/lint-sdk-vendored.sh— passed; vendoring is idempotent.bash tools/lint/lint-cli.sh— passed; CLI generation is idempotent.Summary by CodeRabbit
Improvements
Quality