Skip to content

Conversation

@jeongseok-meta
Copy link
Contributor

@jeongseok-meta jeongseok-meta commented Oct 24, 2025

Summary

This PR enables building wheel files for pymomentum and publishing to PyPI (pymomentum-gpu and pymomentum-cpu).

  • New PyPI workflow with CPU/GPU wheel builds
  • Template-based config system for platform-specific PyTorch versions
  • CI cost optimizations (concurrency control, Python 3.13 skipping)
  • Ubuntu CUDA 12.9.0 installer workaround
  • Disk space optimization for GPU builds
  • Comprehensive documentation added

Usage

With uv (preferred):

uv init . --python 3.12  # if needed
uv add pymomentum-cpu    # or pymomentum-gpu

With pip:

pip install "torch>=2.8,<2.9" pymomentum-cpu  # or pymomentum-gpu

Checklist:

Test Plan

  • CI wheel builds (no publishing)
  • CI publish to PyPI on git tag
  • Local testing with pixi commands (e.g., pixi run -e py313 build_pypi_wheel)

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2025
@jeongseok-meta jeongseok-meta changed the title Add PyPI publishing infrastructure and improve CI workflows Enable PyPI publishing Oct 24, 2025
@jeongseok-meta
Copy link
Contributor Author

Pending #727

@meta-codesync
Copy link
Contributor

meta-codesync bot commented Oct 24, 2025

@jeongseok-meta has imported this pull request. If you are a Meta employee, you can view this in D85481027.

jeongseok-meta added a commit that referenced this pull request Oct 25, 2025
Summary:
This PR enables building wheel files for pymomentum and publishing to PyPI ([`pymomentum-gpu`](https://pypi.org/project/pymomentum-gpu/) and [`pymomentum-cpu`](https://pypi.org/project/pymomentum-cpu/)).

*   New PyPI workflow with CPU/GPU wheel builds
*   Template-based config system for platform-specific PyTorch versions
*   CI cost optimizations (concurrency control, Python 3.13 skipping)
*   Ubuntu CUDA 12.9.0 installer workaround
*   Disk space optimization for GPU builds
*   Comprehensive documentation added

## Checklist:

- [x] Adheres to the [style guidelines](https://facebookresearch.github.io/momentum/docs/developer_guide/style_guide)
- [x] Codebase formatted by running `pixi run lint`

Pull Request resolved: #725

Test Plan:
*   CI wheel builds (no publishing)
*   CI publish to PyPI on git tag
*   Local testing with pixi commands (e.g., `pixi run -e py313 build_pypi_wheel`)

Differential Revision: D85481027

Pulled By: jeongseok-meta
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Oct 25, 2025

@jeongseok-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D85481027.

Summary:
This PR enables building wheel files for pymomentum and publishing to PyPI ([`pymomentum-gpu`](https://pypi.org/project/pymomentum-gpu/) and [`pymomentum-cpu`](https://pypi.org/project/pymomentum-cpu/)).

*   New PyPI workflow with CPU/GPU wheel builds
*   Template-based config system for platform-specific PyTorch versions
*   CI cost optimizations (concurrency control, Python 3.13 skipping)
*   Ubuntu CUDA 12.9.0 installer workaround
*   Disk space optimization for GPU builds
*   Comprehensive documentation added

## Checklist:

- [x] Adheres to the [style guidelines](https://facebookresearch.github.io/momentum/docs/developer_guide/style_guide)
- [x] Codebase formatted by running `pixi run lint`

Pull Request resolved: #725

Test Plan:
https://fb.workplace.com/groups/1222607168126483/permalink/2638230143230838/

*   CI wheel builds (no publishing)
*   CI publish to PyPI on git tag
*   Local testing with pixi commands (e.g., `pixi run -e py313 build_pypi_wheel`)

Differential Revision: D85481027

Pulled By: jeongseok-meta
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Oct 25, 2025

@jeongseok-meta merged this pull request in 7d62e53.

@jeongseok-meta jeongseok-meta deleted the pypi_pub branch October 27, 2025 19:00
meta-codesync bot pushed a commit that referenced this pull request Oct 28, 2025
…els (#738)

Summary:
PyPI was rejecting Linux wheels with [error](https://github.com/facebookresearch/momentum/actions/runs/18853730732/job/53797928855):

`Binary wheel 'pymomentum_cpu-0.1.81.post0-cp312-cp312-linux_x86_64.whl'  has an unsupported platform tag 'linux_x86_64'.`

PyPI requires Linux wheels to use `manylinux` tags (e.g., `manylinux_2_17_x86_64`) instead of generic `linux_x86_64` for cross-distribution compatibility.

The `build_pypi_repair` task was already defined in `pixi.toml` since PR #725, but the CI workflow never called it. This wasn't caught because:

*   CI builds wheels successfully without publishing (no PyPI validation)
*   First actual PyPI publish attempt revealed the issue

Added `build_pypi_repair` step to CI workflow after building wheels on Linux:

*   Runs `auditwheel repair` to convert `linux_x86_64` → `manylinux_*` tags
*   Removes original wheel after repair
*   Skipped on macOS (not needed)

## Checklist:

- [ ] Adheres to the [style guidelines](https://facebookresearch.github.io/momentum/docs/developer_guide/style_guide)
- [ ] Codebase formatted by running `pixi run lint`

Pull Request resolved: #738

Test Plan: Next PyPI publish should succeed with properly tagged `manylinux` wheels.

Reviewed By: nickyhe-gemini

Differential Revision: D85597200

Pulled By: jeongseok-meta

fbshipit-source-id: 10eb68baa893f5e5d31ddab61f8d55deb39df71d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants