Skip to content

apr tensors displays only 100 tensors from APR v2 file containing 291 #195

@noahgift

Description

@noahgift

Summary

The apr tensors command truncates output to 100 tensors even when the APR v2 file contains 291 tensors. The file is correctly formatted and passes all validation.

Steps to Reproduce

  1. Import a GGUF model with 291 tensors using apr import --preserve-q4k
  2. Run apr tensors <output.apr>
  3. Observe only 100 tensors displayed

Expected Behavior

All 291 tensors should be listed.

Actual Behavior

Only 100 tensors displayed (layers 0, 1, 10-16 visible; layers 2-9, 17-23 missing from display).

Evidence

APR Header (correct)

Tensor count: 291
Checksum: Valid (0xbf4b5d26)

Python Verification (all 291 present)

# Tensor index parsing shows all 291 tensors
Tensor 0: blk.0.attn_k.bias
...
Tensor 290: token_embd.weight
Total tensors read from index: 291

apr tensors output (truncated)

Total tensors: 100

Analysis

The file contains all 291 tensors with correct sorting. The issue appears to be in the APR v2 reader's tensor index parsing or the tensor listing logic in aprender::format::tensors::list_tensors_v2.

Possible locations:

  • src/format/v2/mod.rs - TensorIndexEntry::from_bytes parsing
  • src/format/tensors.rs - list_tensors_v2 function

Related

  • realizar#44 (APR import truncation - converter fixes complete)
  • This bug blocks verification of the realizar fixes

Environment

  • aprender version: latest main
  • Input: GGUF file with 291 tensors (qwen2 architecture, 24 layers)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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