Skip to content

feat(packaging): ship PAI converter in nvidia-ncore wheel - #171

Closed
eattia-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
eattia-nvidia:feat/pai-converter-wheel-packaging
Closed

feat(packaging): ship PAI converter in nvidia-ncore wheel#171
eattia-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
eattia-nvidia:feat/pai-converter-wheel-packaging

Conversation

@eattia-nvidia

@eattia-nvidia eattia-nvidia commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

Package the PAI data converter in the nvidia-ncore wheel so PhysicalAI-AV clips can be converted without a source checkout or Bazel.

  • Add pai_converter_pkg to //ncore:ncore_wheel (converter + pai_remote + CLI).
  • Expose console script ncore-converttools.data_converter.pai.converter:cli.
  • Add optional extra nvidia-ncore[pai] for converter deps (Click, DracoPy, imageio, pandas, pyarrow, PyNvVideoCodec, remotezip, requests, tqdm, debugpy).
  • Document installed usage in ncore/PYPI_README.md and tools/data_converter/pai/README.md.
  • Cover packaging with //ncore:pytest_wheel_packaging_3_11.

pai-clip-dl is not shipped as its own console script in this PR; streaming (pai-stream-v4) is the primary no-checkout path. Camera decode via PyNvVideoCodec needs an NVIDIA GPU (Turing+).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

Checklist

  • I have read the Contributing Guidelines
  • My commits follow Conventional Commits format
  • My commits are GPG-signed
  • I have added tests that prove my fix is effective or my feature works
  • New and existing tests pass locally (bazel test //...)
  • Code is formatted (bazel run //:format)
  • I have updated documentation as needed
  • My changes include SPDX license headers on all new files

@copy-pr-bot

copy-pr-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@eattia-nvidia
eattia-nvidia marked this pull request as ready for review August 21, 2026 13:44
Comment thread ncore/BUILD.bazel
],
},
extra_requires = {
"pai": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pai extra is missing runtime dependencies, so pip install "nvidia-ncore[pai]" gives an import error rather than a working converter. tools/data_converter/pai/pai_remote/downloader.py imports rich, which isn't listed, installing the extra and importing that module fails with ModuleNotFoundError: No module named 'rich'. Comparing against the dependency set needed to build the converter as a bazel target, scipy and universal-pathlib also look absent. Worth being clear this isn't introduced here: rich is undeclared in every deps/pip/requirements_*.in on main today. It's just that this MR is what makes the module installable by external users, so a latent gap becomes a user-visible break at exactly the moment the extra ships.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that the extra has to match what the installed converter actually imports.

scipy and universal_pathlib are already required by the base nvidia-ncore wheel, so pip install "nvidia-ncore[pai]" gets them without listing them again on the extra.

rich is only used by pai_remote/downloader.py (and the pai-clip-dl CLI). Those are not part of ncore-convert: streaming conversion uses config / index / remote / streaming, and local conversion reads pai-clip-dl output from disk. downloader.py is no longer packaged, so the extra does not need rich. pai-clip-dl stays a Bazel-only tool in this repo.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, thanks.

Comment thread ncore/BUILD.bazel Outdated
version = "{BUILD_EMBED_LABEL}",
deps = [
":ncore_pkg",
"//tools/data_converter/pai:pai_converter_pkg",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding //tools/data_converter/pai:pai_converter_pkg to the wheel deps means the wheel installs a top-level tools/ package, the built wheel's top-level entries are ['ncore', 'nvidia_ncore-.dist-info', 'tools']. tools is about as generic a name as exists on PyPI, so nvidia-ncore[pai] would collide with anything else installing a tools module in the same environment, and would shadow it depending on install order. Since this is the release that first publishes it, it's much cheaper to namespace now (e.g. under ncore/) than after users depend on the current layout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — a top-level tools package on PyPI is too generic.

The published wheel now installs the converter under ncore.converters (ncore.converters.pai.converter:cli). There is no top-level tools in the wheel. In-repo Bazel targets are unchanged (//tools/data_converter/pai:convert); only the packaged import path is namespaced.

Package the PAI data converter under ncore.converters so PhysicalAI-AV
clips can be converted from an installed wheel without a source checkout.
Add the ncore-convert console script and a [pai] extra for converter deps.
@eattia-nvidia
eattia-nvidia force-pushed the feat/pai-converter-wheel-packaging branch from e66d26b to 365cb9d Compare August 26, 2026 15:06
@@ -0,0 +1,85 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving stuff into ncore/converters to avoid namespace remapping ? @janickm

@janickm
janickm self-requested a review August 31, 2026 08:38
@janickm janickm self-assigned this Aug 31, 2026
@janickm

janickm commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

I have some big reservations on this change and the whole repo and wheel structure is explicitly designed to not ship (the wheel is for APIs, not for tools - the converters are merely "samples" of how to convert common data) - there might be different options here, let's discuss this offline first, I'll reach out (making draft for now)

@janickm
janickm marked this pull request as draft August 31, 2026 08:59
@janickm

janickm commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

closing as discussed offline with the alternative bazel-based http_archive approach

@janickm janickm closed this Aug 31, 2026
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.

3 participants