Skip to content

[TAO-2148][Feature] RADIO distillation: consume core KNN via re-export shim - #78

Open
vpraveen-nv wants to merge 2 commits into
mainfrom
feature/core-eval-c
Open

[TAO-2148][Feature] RADIO distillation: consume core KNN via re-export shim#78
vpraveen-nv wants to merge 2 commits into
mainfrom
feature/core-eval-c

Conversation

@vpraveen-nv

@vpraveen-nv vpraveen-nv commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Dependency inversion for RADIO distillation: radio/distillation/knn_classification.py becomes a thin re-export shim onto the shared core.evaluation.knn module. The math is relocated, not modified — validate.py and the distiller resolve to the same core objects.

Why are the changes needed?

Part 3/5 of the shared core/evaluation embedding-eval suite (epic TAO-2181). Removes a duplicated KNN implementation so SSL and RADIO families evaluate through one code path.

Related issues

JIRA: TAO-2148 (parent epic TAO-2181). N/A for GitHub issues.

Does this PR introduce any user-facing change?

No — behavior-preserving refactor; distillation KNN-top1 unchanged.

How was this patch tested?

Covered by the stack's shared test suite (26 unit tests land in #80, including KNN vote math: FAISS + brute-force + online → 100% on separable data). Distillation KNN-top1 verified unchanged.

Was this patch authored or co-authored using generative AI tooling?

Yes

Release note

NONE

Checklist

  • My commits are signed off per the DCO (git commit -s) — see CONTRIBUTING.md
  • I have read the contributing guidelines
  • The code follows the project's style, and lint and format checks pass locally
  • I added or updated tests covering this change
  • All tests pass locally
  • I added or updated documentation (README, docstrings, docs pages, examples)
  • I updated the version, changelog, or migration notes if this change requires it
  • If this touches components that are optional to install, the imports are guarded
    so the package still works without them (reviewers: please verify this)
  • No secrets, credentials, proprietary data, or customer data are included in this PR
  • I understand this contribution is licensed under the repository's license, and that
    my commit author name and email become permanently public once merged

Notes for reviewers

Review the core-eval stack in order: #78#79#80#81 (this is part 3/5; parts 1–2 merged on GitLab before migration).


Migrated from GitLab MR nvidia-tao-toolkit/tao-pytorch!616, rebased onto GitHub main.

@vpraveen-nv
vpraveen-nv requested a review from a team as a code owner August 5, 2026 23:04
@tao-pr-bot

tao-pr-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

For security reasons, CI does not run automatically on NVIDIA's runners — it must be triggered per commit.

  • Comment /build to run CI on your latest commit, and make sure blossom-ci is green before merging.
  • Re-run /build after each new push — CI is pinned to the head commit, so a stale run won't count.

Tip

Should this fix also ship in a release? Add a release/X.Y.Z label (matching the target release branch) and tao-cherry-pick-bot will backport it after merge.

Important

Before merging: every file needs a license header and every commit must be DCO signed-off — see the 📖 Contribution guide for details.

@vpraveen-nv

Copy link
Copy Markdown
Contributor Author

/build

@vpraveen-nv
vpraveen-nv force-pushed the feature/core-eval-c branch from 115f687 to a5da29e Compare August 7, 2026 16:39
vpraveen-nv and others added 2 commits August 10, 2026 12:25
…t shim

Dependency inversion: radio/distillation/knn_classification.py becomes a thin
re-export shim onto nvidia_tao_pytorch.core.evaluation.knn. The KNN vote math
(distributed_topk, knn_top1_accuracy, _get_vote_cls) is now owned by the shared
suite and merely relocated here, so existing imports keep working and the
distillation KNN-top1 numbers are unchanged (validate.py + the distiller resolve
to the same core objects).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Varun Praveen <vpraveen@nvidia.com>
Nested single quotes inside f-string replacement fields are only valid
from Python 3.12 (PEP 701). CI lints on Python 3.11, so pylint/flake8
report a syntax error for any change set that touches or imports this
module. Flip the outer quotes to double quotes; no behavior change.

Signed-off-by: Varun Praveen <vpraveen@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant