Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
077f0af
Studio: add an Auto download transport, cap Xet memory, and detect a …
danielhanchen Aug 2, 2026
5f78e7d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2026
cab7c30
Retry the zoo Xet-helper import with GPU init disabled
danielhanchen Aug 2, 2026
868e0dd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2026
1be7e51
Studio: clear Xet high-performance without depending on the zoo tunin…
danielhanchen Aug 2, 2026
1a0654e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2026
9fa856e
Isolate the persisted Xet health verdict in the backend test suite
danielhanchen Aug 2, 2026
74f85f2
Fix seven review findings: dead Auto verdict, hanging test, unscoped …
danielhanchen Aug 3, 2026
d1db7d4
Fix two more review findings: Auto never probed, unserialized GPU-ini…
danielhanchen Aug 3, 2026
c4d6fd1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
cbe0ec7
Fix four review findings: split env lock, cached-job success, test sk…
danielhanchen Aug 3, 2026
f465e47
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
db19179
Scope Xet success accounting to the job's own blobs, and stop moving …
danielhanchen Aug 3, 2026
2d7b96b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
fc8eae8
Size the hub connect budget for its own pre-byte phase, and keep pre-…
danielhanchen Aug 3, 2026
f79b0ce
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
ec6c6f2
Sample the Xet byte baseline before the worker spawns
danielhanchen Aug 3, 2026
013e8b6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
7dfbc55
Filter watchdog kwargs to the installed zoo, and skip the Xet baselin…
danielhanchen Aug 3, 2026
c068acd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
49fe5c8
Record a Xet health failure for post-byte hangs, not just pre-byte ones
danielhanchen Aug 3, 2026
3c8b1ff
Stop the loader's transient GPU-init override leaking into spawned ch…
danielhanchen Aug 3, 2026
dd043e8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
6ceeab2
Exclude spawned workers from the loader's GPU-init override window
danielhanchen Aug 3, 2026
c5c80a3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2026
5f3e783
Make the loader barrier reentrant so a nested spawn cannot deadlock
danielhanchen Aug 3, 2026
47c27b0
Say what the dropped pre-byte budget actually costs on the floor
danielhanchen Aug 3, 2026
46fb2bd
Tighten the comments on the Xet auto-transport path
danielhanchen Aug 3, 2026
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
20 changes: 18 additions & 2 deletions studio/backend/hub/schemas/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ class DownloadModelRequest(BaseModel):
)
use_xet: bool = Field(
True,
description = "Use Xet parallel chunked transport. Default True; set False for HTTP Range-resume.",
description = "Legacy transport flag, superseded by transport_mode. Kept so an older "
"frontend or a scripted caller keeps working.",
)
transport_mode: Optional[Literal["auto", "xet", "http"]] = Field(
None,
description = "Transport preference. 'auto' (the default in the UI) lets the backend pick "
"per machine: it knows this host's RAM, its hf_xet build, and whether Xet has "
"been failing here. 'xet'/'http' force one. Omitted -> use_xet decides.",
)


Expand Down Expand Up @@ -93,6 +100,8 @@ class TransportCapability(BaseModel):
class TransportCapabilities(BaseModel):
http: TransportCapability
xet: TransportCapability
auto_resolves_to: Literal["xet", "http"] = "xet"
auto_reason: Optional[str] = None


class TransportStatusResponse(BaseModel):
Expand Down Expand Up @@ -126,7 +135,14 @@ class DownloadDatasetRequest(BaseModel):
repo_id: str = Field(..., description = "HuggingFace dataset repo ID")
use_xet: bool = Field(
True,
description = "Use Xet parallel chunked transport. Default True; set False for HTTP Range-resume.",
description = "Legacy transport flag, superseded by transport_mode. Kept so an older "
"frontend or a scripted caller keeps working.",
)
transport_mode: Optional[Literal["auto", "xet", "http"]] = Field(
None,
description = "Transport preference. 'auto' (the default in the UI) lets the backend pick "
"per machine: it knows this host's RAM, its hf_xet build, and whether Xet has "
"been failing here. 'xet'/'http' force one. Omitted -> use_xet decides.",
)


Expand Down
9 changes: 8 additions & 1 deletion studio/backend/hub/services/datasets/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,15 @@ async def download_dataset_response(
repo_id = await asyncio.to_thread(resolve_cached_repo_id_case, repo_id, repo_type = "dataset")
key = _download_job_key(repo_id)

use_xet = download_lifecycle.resolve_effective_use_xet(body.use_xet)
# Off the event loop: resolving "auto" can run the Xet reachability probe, and a blackholed
# DNS makes that outlast its 3s budget while every other Studio request waits behind it.
use_xet, transport_reason = await asyncio.to_thread(
download_lifecycle.resolve_requested_use_xet,
getattr(body, "transport_mode", None),
body.use_xet,
)
transport = download_lifecycle.resolve_transport(use_xet)
logger.info("Download transport for %s: %s (%s)", repo_id, transport, transport_reason)
from utils.hf_cache_settings import get_hf_cache_paths

cache_paths = get_hf_cache_paths()
Expand Down
314 changes: 314 additions & 0 deletions studio/backend/hub/services/download_lifecycle.py

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion studio/backend/hub/services/models/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,15 @@ async def download_model_response(
detail = f"Invalid gguf_variant: {variant!r}",
)
key = _download_job_key(repo_id, variant)
use_xet = download_lifecycle.resolve_effective_use_xet(body.use_xet)
# Off the event loop: resolving "auto" can run the Xet reachability probe, and a blackholed
# DNS makes that outlast its 3s budget while every other Studio request waits behind it.
use_xet, transport_reason = await asyncio.to_thread(
download_lifecycle.resolve_requested_use_xet,
getattr(body, "transport_mode", None),
body.use_xet,
)
transport = download_lifecycle.resolve_transport(use_xet)
logger.info("Download transport for %s: %s (%s)", repo_id, transport, transport_reason)
from utils.hf_cache_settings import get_hf_cache_paths

cache_paths = get_hf_cache_paths()
Expand Down
Loading
Loading