sgl-project/sglang · error · FileNotFoundError
Could not resolve backbone.pt from: {path}
Error message
Could not resolve backbone.pt from: {path} What it means
_resolve_backbone_ckpt expects either a direct path to a backbone.pt file or a directory containing backbone.pt; neither exists at the given location.
Source
Thrown at python/sglang/multimodal_gen/tools/build_modelopt_fp8_transformer.py:229
def _resolve_transformer_dir(path: str) -> str:
candidate = Path(path).expanduser().resolve()
if (candidate / "config.json").is_file():
return str(candidate)
transformer_dir = candidate / "transformer"
if (transformer_dir / "config.json").is_file():
return str(transformer_dir)
raise FileNotFoundError(f"Could not resolve a transformer directory from: {path}")
def _resolve_backbone_ckpt(path: str) -> str:
candidate = Path(path).expanduser().resolve()
if candidate.is_file():
return str(candidate)
backbone_path = candidate / "backbone.pt"
if backbone_path.is_file():
return str(backbone_path)
raise FileNotFoundError(f"Could not resolve backbone.pt from: {path}")
def _find_index_file(model_dir: str) -> str | None:
for filename in INDEX_FILENAMES:
candidate = os.path.join(model_dir, filename)
if os.path.isfile(candidate):
return filename
matches = sorted(
filename
for filename in os.listdir(model_dir)
if filename.endswith(".safetensors.index.json")
)
return matches[0] if matches else None
def _load_weight_map(model_dir: str) -> tuple[dict[str, str], str | None]:
index_filename = _find_index_file(model_dir)View on GitHub (pinned to 0132848349)
Solutions
- Locate backbone.pt in your export (find /path -name backbone.pt)
- Pass the direct file path if it exists under another name only after renaming/copying it to backbone.pt
- Point at the directory that actually contains backbone.pt
Example fix
# before --base-transformer-dir /data/export # no backbone.pt # after --base-transformer-dir /data/export/backbone
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
def has_backbone(p: str) -> bool:
c = Path(p).expanduser().resolve()
return c.is_file() or (c / "backbone.pt").is_file() Try / catch
try:
d = _resolve_backbone_ckpt(path)
except FileNotFoundError as e:
logger.error("%s", e)
raise Prevention
- Keep backbone.pt at the documented location in BF16 exports
When it happens
Trigger: Passing --base-transformer-dir (or backbone path) where backbone.pt is missing or named differently.
Common situations: The BF16 fallback source export kept original naming instead of backbone.pt; the backbone file lives one level deeper than expected.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Could not resolve a transformer directory from: {path}
- Expected an index file or a single safetensors shard in {mod
- Only per-tensor FP8 scales are supported for diffusion check
- Expected a flat quantization_config dict in the ModelOpt exp
- This tool only supports ModelOpt diffusers FP8 exports (quan
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/db913463fa3e990c.
Report an issue: GitHub.