Skip to content

SafeTensors: tensorFilter on the single-file SafeTensorsParametersLoader (parity with the sharded loader) #1256

Description

@michalharakal

Follow-up to #1246 / #1252, found while collapsing the SKaiNET-transformers family loaders onto the engine loaders.

ShardedSafeTensorsParametersLoader (0.53.0) takes a tensorFilter: ((ShardedTensorInfo) -> Boolean)? so a family can keep its name allowlist / size guards family-side while the engine owns every dtype decision. The single-file SafeTensorsParametersLoader has no equivalent: it materializes every tensor in the file and its per-arm dtype require throws on the first tensor the requested dtype can't accept.

Consequences downstream (SKaiNET-transformers):

Proposal (~10 lines, mirrors the sharded loader): tensorFilter: ((StreamingSafeTensorInfo) -> Boolean)? = null on SafeTensorsParametersLoader and its withPolicy companion, applied before delivery and before any fail-fast pre-scan. With it, Voxtral becomes engine loader for BF16/F16/F32 + a family-side Q4 path over the engine reader, and llm-core's legacy path shrinks to Q4-only. A SafeTensorsParametersLoader fail-fast pre-scan (the sharded loader has one, #919-style) would be the natural companion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions