Skip to content

fix(xla): drop as_str on the safetensors 0.8 tensor name - #2820

Closed
inureyes wants to merge 1 commit into
mainfrom
fix/xla-safetensors-names
Closed

inureyes wants to merge 1 commit into
mainfrom
fix/xla-safetensors-names

Conversation

@inureyes

@inureyes inureyes commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

safetensors 0.8 returns &str from SafeTensors::names(), so the name.as_str() left in the Youtu-VL runtime hit the unstable str_as_str library feature and broke cargo check --features cuda,xla-iree, the OpenXLA feature compile job on #2819. That code needs IREE_DIST and could not compile locally, so this fix relies on the CI job.

The XLA features are not part of the v0.8.0 release builds, which use --features cuda and the macOS defaults.

Refs #2819

Update

With the str_as_str error gone, the same job's xla-diagnostics step failed on four format!("{:x}", Sha256::digest(..)) sites, because sha2 0.11 returns a hybrid_array::Array without LowerHex: one in src/models/gemma3n.rs and three in src/multimodal/host_preprocessor_molmo_diagnostics_support.rs. A fifth copy in src/loading/vlm_gemma_xla_tests.rs sits behind xla-reference-diagnostics, which the job does not compile. PR #2837 routes all of them through the existing sha256_hex helper.

safetensors 0.8 returns `&str` from `SafeTensors::names()`, so the `name.as_str()` left in the Youtu-VL runtime hit the unstable `str_as_str` library feature and broke `cargo check --features cuda,xla-iree`, the OpenXLA feature compile job on #2819. That code needs `IREE_DIST` and could not compile locally, so this fix relies on the CI job.

The XLA features are not part of the v0.8.0 release builds, which use `--features cuda` and the macOS defaults.

Refs #2819
@inureyes inureyes added the type:bug Bug fixes, error corrections, or issue resolutions label Nov 1, 2026
inureyes added a commit that referenced this pull request Nov 2, 2026
safetensors 0.8 returns `&str` from `SafeTensors::names()`, so the `name.as_str()` left in the Youtu-VL runtime resolved to the unstable `str_as_str` library feature and broke `cargo check --features cuda,xla-iree`, the first of the OpenXLA job's two steps. `required` is a `BTreeSet<&str>`, so it takes the borrowed name directly.

The second step, `xla-diagnostics`, then failed on four `format!("{:x}", Sha256::digest(..))` sites: sha2 0.11 returns a `hybrid_array::Array` that no longer implements `LowerHex`. Three are reachable in that job (Gemma3n diagnostics, the Molmo diagnostics support module) and one sits behind `xla-reference-diagnostics`, which CI does not compile; all now call the `sha256_hex` helper #2819 added for exactly this reason.

Validation: `cargo check --features cuda,xla-iree --all-targets`, `cargo check --no-default-features --features xla-diagnostics --all-targets`, and `cargo check --features xla-reference-diagnostics --all-targets` against the provisioned IREE runtime on spark-102, all exit 0.

Closes #2820
inureyes added a commit to daemyung-lablup/mlxcel that referenced this pull request Nov 2, 2026
…ablup#2837)

safetensors 0.8 returns `&str` from `SafeTensors::names()`, so the `name.as_str()` left in the Youtu-VL runtime resolved to the unstable `str_as_str` library feature and broke `cargo check --features cuda,xla-iree`, the first of the OpenXLA job's two steps. `required` is a `BTreeSet<&str>`, so it takes the borrowed name directly.

The second step, `xla-diagnostics`, then failed on four `format!("{:x}", Sha256::digest(..))` sites: sha2 0.11 returns a `hybrid_array::Array` that no longer implements `LowerHex`. Three are reachable in that job (Gemma3n diagnostics, the Molmo diagnostics support module) and one sits behind `xla-reference-diagnostics`, which CI does not compile; all now call the `sha256_hex` helper lablup#2819 added for exactly this reason.

Validation: `cargo check --features cuda,xla-iree --all-targets`, `cargo check --no-default-features --features xla-diagnostics --all-targets`, and `cargo check --features xla-reference-diagnostics --all-targets` against the provisioned IREE runtime on spark-102, all exit 0.

Closes lablup#2820
@inureyes inureyes added status:done Completed priority:medium Medium priority labels Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant