Skip to content

chore(inference): fix 30 compiler warnings in metal_qwen35.rs (unused imports, unsafe blocks, dead code) #181

@ohdearquant

Description

@ohdearquant

Problem

cargo build --release --features metal-gpu,f16 emits 30 warnings from metal_qwen35.rs:

  • Unused import: crate::sampling::CandidateSet (line 40)
  • Unnecessary unsafe blocks (lines 6766, 6814)
  • Private type leaked in pub field: MetalMtpCache (line 2722)
  • Dead methods: append_kv (line 3551), full_attention_layer_step_by_idx (line 8485), softplus (line 10791)

Why

Dead code signals unmaintained paths. append_kv being dead means the CPU KV-append path (f32 pointer writes) is not used — the GPU dispatch_copy_offset path is the real one. This is relevant for #154 (f16 KV): the migration only needs to touch the GPU copy path, not the dead CPU path.

The warnings also make CI noisy and mask real issues.

Scope

  • Remove dead methods (append_kv, full_attention_layer_step_by_idx, softplus)
  • Remove unused import
  • Remove redundant unsafe blocks
  • Fix visibility on MetalMtpCache
  • Target: zero warnings with --features metal-gpu,f16

Related: #152 (decompose), ADR-064 (clean baseline for perf work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    lattice-inferenceAffects the lattice-inference crate (transformer inference)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions