[CI][ROCm] Make hf-xet reconstruction safe on shared NFS (#49837)

Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: OpenAI Codex <noreply@openai.com>

Andreas Karatzas committed Jul 27, 2026 at 04:23 UTC 312ea82e758a27a333e4254cc7669ae1a5d7c69e
1 file changed +13
.buildkite/scripts/hardware_ci/run-amd-test.sh
+13
@@ -387,6 +387,7 @@ initialize_native_environment() {
387 local job_id="${BUILDKITE_JOB_ID:-${BUILDKITE_PARALLEL_JOB:-local}}"
388 local job_id_suffix=""
389 local native_root=""
390 + local hf_fstype=""
391 local hf_mount=""
392
393 if [[ "$(id -u)" -ne 0 ]]; then
@@ -436,6 +437,18 @@ initialize_native_environment() {
437 return 1
438 fi
439 fi
440 +
441 + if command -v findmnt >/dev/null 2>&1; then
442 + hf_fstype=$(findmnt -n -T "${HF_HOME}" -o FSTYPE 2>/dev/null || true)
443 + fi
444 + if [[ "${hf_fstype}" == nfs || "${hf_fstype}" == nfs4 ]]; then
445 + # Keep hf-xet state local and avoid vectored writes on shared NFS.
446 + export HF_XET_CACHE="${native_root}/cache/hf-xet"
447 + export HF_XET_HIGH_PERFORMANCE=0
448 + export HF_XET_RECONSTRUCTION_USE_VECTORED_WRITE=0
449 + mkdir -p "${HF_XET_CACHE}" || return 1
450 + echo "Configured hf-xet for shared ${hf_fstype} cache at ${HF_HOME}"
451 + fi
452 }
453
454 run_native_preflight() {