Skip to content

LTX2 BF16 safetensors loader performs misaligned uint16_t reads #693

Description

@localai-bot

Problem

The hosted address/undefined sanitizer job on PR #524 fails in test_ltx2_video because Ltx2LoadVaeWeights casts StTensor::data to const uint16_t* and indexes it. Safetensors payload offsets are byte offsets and the observed fixture payload starts at an odd address, so the dereference is undefined behavior.

Evidence from Actions run 31737430012, job 94572345351:

  • src/vllm/model_executor/models/ltx2_loader.cpp:1325
  • UBSan: load of misaligned address for const uint16_t, which requires 2-byte alignment
  • failing test: test_ltx2_video

Required outcome

Load each BF16 element without assuming alignment, preserve the exact BF16-to-F32 conversion, add a regression whose tensor payload is deliberately odd-aligned, and pass the focused and full sanitizer gates.

This repair belongs in PR #524 so the release-binary campaign has one fully green integration PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions