pytorch - 💡(How to fix) Fix [RFC] Best practices for backend installations requiring +cpu / non-PyPI wheels [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#180215Fetched 2026-04-15 06:19:19
View on GitHub
Comments
1
Participants
2
Timeline
47
Reactions
0
Timeline (top)
mentioned ×18subscribed ×18labeled ×8unlabeled ×2
RAW_BUFFERClick to expand / collapse

I am opening this RFC to seek guidance and establish a standard recommendation for installing third-party PyTorch backends (e.g., torch-rbln) that depend on specific PyTorch builds (such as torch==2.9.1+cpu) hosted on download.pytorch.org.

The Problem

Since specialized builds like +cpu are not available on PyPI, downstream backends currently face a dilemma between user convenience and supply chain security:

  1. The --extra-index-url approach (Common but insecure): pip install torch-rbln --extra-index-url https://download.pytorch.org/whl/cpu This provides a seamless UX but opens the door to Dependency Confusion attacks, as pip searches both indices for all packages during resolution.

  2. The Two-Step --index-url approach (Secure but cumbersome): pip install torch==2.9.1+cpu --index-url https://download.pytorch.org/whl/cpu pip install torch-rbln This safely restricts pip to the intended index but introduces significant friction for end-users and CI/CD environments.

Discussion Points

As an increasing number of hardware-accelerated backends encounter this split-index issue, an official stance from the PyTorch packaging team would significantly benefit the ecosystem.

  • Should backend maintainers explicitly mandate the two-step installation in their documentation to prioritize security, despite the UX degradation?
  • Are there any planned packaging mechanisms, standardized pip workflows, or official tooling to handle these non-PyPI dependencies safely without exposing users to risks?

We welcome insights from the community and packaging experts on establishing a secure and unified best practice for the broader PyTorch ecosystem.

cc @seemethere @malfet @atalman @tinglvv @nWEIdia @NmomoN @mengpenghui @fwenguang @cdzhan @1274085042 @PHLens @albanD

extent analysis

TL;DR

Consider using the two-step --index-url approach for secure installation of PyTorch backends, despite the potential for user experience degradation.

Guidance

  • Evaluate the trade-off between user convenience and supply chain security when choosing an installation method for third-party PyTorch backends.
  • Consider documenting the two-step installation process in backend documentation to prioritize security, even if it introduces friction for end-users.
  • Investigate potential future packaging mechanisms or standardized pip workflows that could handle non-PyPI dependencies safely.
  • Engage with the PyTorch packaging team and community to establish a unified best practice for installing third-party backends.

Notes

The optimal solution may depend on future developments in PyTorch packaging and pip workflows, so it's essential to monitor updates and community discussions.

Recommendation

Apply the two-step --index-url approach as a workaround, as it prioritizes security despite being more cumbersome for users. This approach is recommended until a more secure and convenient solution is developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING