Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion atom/examples/simple_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def main():
"1+2+3=?",
"如何在一个月内增肌10公斤",
"+".join([f"{i}-{i+1}" for i in range(1000)]) + "=? 最后结果是什么",
"+".join([f"{i}+{i+1}" for i in range(3000)]) + "=? 最后结果是什么",
"+".join([f"{i}+{i+1}" for i in range(1500)]) + "=? 最后结果是什么",
]
args = parser.parse_args()
# Generate power of 2 sizes for CUDA graph: [1, 2, 4, 8, ...]
Expand Down
10 changes: 10 additions & 0 deletions atom/model_loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@
from typing import Any

import safetensors
import safetensors.torch
import torch
from torch import nn
from tqdm import tqdm
from transformers import AutoConfig

# safetensors<=0.7.0 ships a Python `_TYPES` dict missing the `F8_E8M0`
# (MX scale) entry, even though both torch and the safetensors-rust binary
# support it. The mmap'd `safe_open` path goes through Rust and works, but
# the `safetensors.torch.load(bytes)` path used when `ATOM_DISABLE_MMAP=true`
# raises `KeyError: 'F8_E8M0'` on DeepSeek-V4-Pro shards. Register the
# missing dtype string so both paths behave identically.
if "F8_E8M0" not in safetensors.torch._TYPES and hasattr(torch, "float8_e8m0fnu"):
safetensors.torch._TYPES["F8_E8M0"] = torch.float8_e8m0fnu

from atom.utils import envs
from transformers.utils import SAFE_WEIGHTS_INDEX_NAME

Expand Down
Loading