docs(xet): document shard/chunk cache and other Xet environment variables - #2668
Merged
Conversation
…bles Add Shard Cache, Chunk Cache, and Deduplication sections to the Using Xet Storage environment-variable reference, plus a General section for the high-level flags: HF_XET_HIGH_PERFORMANCE (alias HF_XET_HP), HF_XET_CACHE, HF_HUB_DISABLE_XET, HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY, and HF_XET_NUM_CONCURRENT_RANGE_GETS. Adds HF_XET_SHARD_CACHE_SIZE_LIMIT (the customer-requested variable) and the rest of the shard config (target sizes, in-memory chunk index cap, cache subdir), the chunk cache size, and the global-dedup query controls. Defaults verified against xet-core (v1.5.1 and main): - shard cache soft limit is 16 GB (the huggingface_hub reference page still says 4 GB — stale). - chunk cache defaults to 0 for hf_xet (built with no-default-cache) but 10 GB for Git Xet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XmgpfqHUeQtJthDXJddq9
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Drop HF_HUB_DISABLE_XET from the General table, remove the shard target-size knobs (HF_XET_SHARD_TARGET_SIZE, HF_XET_SHARD_MAX_TARGET_SIZE), and remove the Deduplication section entirely — these are not intended for users to change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XmgpfqHUeQtJthDXJddq9
seanses
reviewed
Jul 29, 2026
seanses
reviewed
Jul 29, 2026
seanses
reviewed
Jul 29, 2026
- Remove HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY: writes are now always buffered sequential writes pinned to a single writer thread, so the knob no longer exists in xet-core. - Remove HF_XET_NUM_CONCURRENT_RANGE_GETS: per-file range concurrency is tuned by adaptive concurrency (documented below). - HF_XET_CHUNK_CACHE_SIZE_BYTES: default is 0 (disabled); the 10 GB "Git Xet" default was wrong — Git Xet v0 goes through the bridge, where the variable has no effect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W8jqRXpFx1SoS9V8iHbkL4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Expands the Environment Variables section of Using Xet Storage with the Xet client's user-tunable variables that weren't yet documented. Three new subsections:
HF_XET_HIGH_PERFORMANCE(aliasHF_XET_HP),HF_XET_CACHEHF_XET_SHARD_CACHE_SIZE_LIMIT,HF_XET_SHARD_CHUNK_INDEX_TABLE_MAX_SIZE,HF_XET_SHARD_CACHE_SUBDIRHF_XET_CHUNK_CACHE_SIZE_BYTESWhy
HF_XET_SHARD_CACHE_SIZE_LIMITcame up in a customer migration: withHF_XET_HIGH_PERFORMANCE=1, the on-disk shard cache can grow enough to fill the disk, and capping it below free space is the fix — but the variable wasn't documented here. This change also folds in the "other Xet environment variables" listed on thehuggingface_hubreference page so the Hub page is self-contained.Accuracy notes (verified against xet-core
v1.5.1andmain)xet_runtime/src/config/groups/shard.rs), not 4 GB. Thehuggingface_hubenv-vars page still says 4 GB — stale; worth a follow-up there.0(disabled):hf_xet's Cargo default enablesno-default-cache. Per @seanses, the10 GBbuild-feature default doesn't apply to Git Xet either — Git Xet v0 goes through the bridge, where the variable has no effect. Documented as a single default plus that caveat.HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY(writes are now always buffered sequential writes pinned to one writer thread) andHF_XET_NUM_CONCURRENT_RANGE_GETS(superseded by adaptive concurrency). Neither exists in xet-core anymore; both still appear on thehuggingface_hubenv-vars page — stale, follow-up needed there too.Scope
Limited to user-facing knobs. Internal/testing fields (CAS endpoint/scheme/prefix, session xorb-flush internals, dedup fragmentation estimators and global-dedup query controls, shard target sizes, progress-aggregation internals,
USE_VECTORED_WRITE,HF_HUB_DISABLE_XET) are intentionally left out. Purely additive — no existing rows changed.🤖 Generated with Claude Code
https://claude.ai/code/session_012XmgpfqHUeQtJthDXJddq9
Note
Low Risk
Documentation-only additions to the Hub Xet guide; no runtime, auth, or data-path code changes.
Overview
Expands the Environment Variables section in
using-xet-storage.mdso Hub readers can tune Xet without cross-linking only tohuggingface_hub.Adds a General table for
HF_XET_HIGH_PERFORMANCE/HF_XET_HPandHF_XET_CACHE, plus new Shard Cache and Chunk Cache sections. Shard docs call out the 16 GB soft on-disk limit forHF_XET_SHARD_CACHE_SIZE_LIMIT, pruning at run start, and when to lower the cap (e.g. under high-performance mode filling disk). Chunk cache docs notehf_xetdefaults to disabled (0) and thatHF_XET_CHUNK_CACHE_SIZE_BYTESdoes not apply to Git Xet v0.Existing adaptive concurrency, network, buffer, and logging tables are unchanged.
Reviewed by Cursor Bugbot for commit cebcfd0. Bugbot is set up for automated code reviews on this repo. Configure here.