Skip to content

Optional HF cache path in cluster config (export HF_HOME on launch) #141

Description

@amazloumi

What

KempnerForge loads vision encoders and tokenizers via HuggingFace from_pretrained, which caches downloads in the default HF location (under the user's home directory). On many clusters home storage is limited, so a large download (e.g. a SigLIP2 vision tower) can exceed the available space and the run fails. Let users set the HF cache location once in the per-user cluster config, and have check_env export it as HF_HOME at launch — consistent with the existing HF-token / WANDB checks and the ib_interface → NCCL_SOCKET_IFNAME export pattern. This is convenience over setting the env var by hand, and is complementary to pointing vision_encoder.path at a local directory (which skips downloading entirely).

Scope

  • configs/cluster/local.toml(.example): an optional cache-dir field (e.g. [paths].hf_cache).
  • scripts/check_env.py: read it and export HF_HOME into the generated launch scripts; optionally warn if the location looks unsuitable.
  • Docs: a short how-to note (cache location + the local-path alternative).
  • Decision: export at launch only, or also set it early in train.py (before transformers is imported) to cover interactive / direct runs.

Backward compatibility

Fully backward compatible — new optional field; unset = current behavior. No change to the training runtime or model code.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions