Views
No views yet
.pt file because traditionally we serialize and distribute TorchAO quantized model with PyTorch native APIs, specifically:1torch.save(model.state_dict())
2state_dict = torch.load("model_fp8.pt", weights_only=True)
3model.load_state_dict(state_dict, assign=True)torch.compile can the expected acceleration effect be achieved. Of course, this acceleration usually does not reach 2x.

1git clone https://github.com/AaronCaoZJ/BAGEL.git # Forked from OG ByteDance-Seed/Bagel
2cd BAGEL
3conda create -n bagel python=3.10 -y
4conda activate bagel
5pip install -r requirements.txt
6pip install torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.org/whl/cu128
7pip install packaging ninja
8pip install flash-attn==2.8.3 --no-build-isolation # FlashAttention only supports Ampere GPUs or newer
9pip install torchao==0.13.0 # compatible with torch==2.8.0
101from huggingface_hub import snapshot_download
2save_dir = "models/BAGEL-7B-MoT"
3repo_id = "aaroncaozj/BAGEL-7B-MoT_FP8"
4cache_dir = save_dir + "/cache"
5snapshot_download(cache_dir=cache_dir,
6 local_dir=save_dir,
7 repo_id=repo_id,
8 local_dir_use_symlinks=False,
9 resume_download=True,
10 allow_patterns=["*.json", "*.safetensors", ".pt", "*.bin", "*.py", "*.md", "*.txt"],)1# For multi GPUs.
2python app-ao.py
3
4# If you want to simultaneously obtain algorithm-level acceleration from Taylorseer.
5python app-ao-ts.py
6# For single 32 GB+ VRAM GPU like H100.
7python app-h100-ao-ts.py