TrasMuon
Optimizer implementation for TrasMuon: Trust-Region Adaptive Scaling for Orthogonalized Momentum Optimizers. TrasMuon combines Muon with adaptive scaling, trust-region column gating, and schedule-free smoothing.
Installation
Requires Python ≥ 3.10, PyTorch ≥ 2.5.1, and Triton. Use Linux with CUDA-enabled PyTorch for GPU execution.
Install from GitHub:
pip install git+https://github.com/zangjiucheng/TrasMuon.git
After the first PyPI release, install with:
pip install trasmuon-pytorch
Usage
from trasmuon import TrasMuon
optimizer = TrasMuon(model.parameters(), lr=1e-3, weight_decay=0.01)
optimizer.zero_grad(set_to_none=True)
loss = loss_fn(model(inputs), targets)
loss.backward()
optimizer.step()
Two-dimensional parameters use TrasMuon; other parameter shapes use the optimizer's AdamW fallback. See TrasMuon.__init__ for available options.
Files
trasmuon/optimizer.py: optimizer implementation.trasmuon/newton_schulz_triton.py: required Newton–Schulz kernel dependency.trasmuon/__init__.py: exportsTrasMuon.
Publishing
Build and validate a release locally:
python -m pip install build twine
python -m build
python -m twine check --strict dist/*
For the first release, add a pending Trusted Publisher on PyPI with:
- Project:
trasmuon-pytorch - Owner / repository:
zangjiucheng/TrasMuon - Workflow:
publish.yml - Environment:
pypi
Create the matching pypi environment in the GitHub repository settings. Update the version in pyproject.toml, then publish a GitHub Release with the matching tag (initially v0.1.0). The release workflow builds and validates both distributions, then publishes them through Trusted Publishing. No PyPI API token is needed. See the PyPI setup guide.
Citation
If you use this code, cite the TrasMuon paper:
@misc{cheng2026trasmuon,
title = {TrasMuon: Trust-Region Adaptive Scaling for Orthogonalized Momentum Optimizers},
author = {Peng Cheng and Jiucheng Zang and Qingnan Li and Liheng Ma and Yufei Cui and Yingxue Zhang and Boxing Chen and Ming Jian and Wen Tong},
year = {2026},
eprint = {2602.13498},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2602.13498}
}
License
This repository is released under the MIT license. See LICENSE and NOTICE.md.
Metadata
Release files for trasmuon-pytorch 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| trasmuon_pytorch-0.1.0.tar.gz | 247.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| trasmuon_pytorch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 263.7 kB
Release files / trasmuon_pytorch-0.1.0.tar.gz
| Download URL | trasmuon_pytorch-0.1.0.tar.gz |
|---|---|
| Size | 247.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87e89de7b0f09369732cb350b876aebb9b7bab61e8b0e8aca9b007b413b53f7d
|
|
BLAKE2b-256 checksum How to use checksums |
ffb5cc0e8190850b3b9eefb698691b4c675ece4ae54b3df23004a3a4e31c39f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / trasmuon_pytorch-0.1.0-py3-none-any.whl
| Download URL | trasmuon_pytorch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bc286fed573c4b8834a5a310d4f4eba379f23268cddf5579048cb9f7607e896
|
|
BLAKE2b-256 checksum How to use checksums |
ed8a81e0995d32a627f04ed61b29e540f492278c0e89281781b3b01ec7c595f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for trasmuon-pytorch 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for trasmuon_pytorch-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.