Forward pass reference β€” model.py needed for NumPy inference

#1
by Riderk - opened

Hi AMFORGE team,

I'm running SAM-G-CobraTooling in pure NumPy (no PyTorch) on an Android
device. The tokenizer, weights, and config all load correctly, but the
forward pass always produces the SAME output regardless of input.

Tested inputs that give near-identical output:

  • "[CHAT] hi"
  • "[CHAT] what is a mutex"
  • "[ACTION] open src/main.js and run the tests"

This suggests either the attention is collapsing or the diversity module
plays a critical role we're not reproducing.

Tried:

  • Causal mask on/off
  • QKV split [q,k,v] and interleaved
  • Positional embeddings 0/1-based, forward and reversed
  • Block order 0β†’7 and 7β†’0
  • Diversity: off / pares / todos / final
  • BOS token on/off
  • Repetition penalty 1.0 to 2.0

All produce the same "theX" token pattern.

Could you share the reference model.py (forward pass only is enough)?
The README documents the input format but not the attention/norm details.

Thanks!

Riderk changed discussion status to closed
Riderk changed discussion status to open
AMEFORGE org

Hi, thanks for the detailed report β€” clearly a lot of real work went into this.

We can't share the reference model.py β€” the implementation is proprietary. The published weights assume the exact forward pass they were trained with, so a from-scratch reimplementation will diverge in ways that are hard to debug blind.

That said, we're interested in what you're building β€” running it on Android is exactly the kind of edge use case we care about. If you'd like to dig deeper, reach us at contact@ameforge.tech and we can look at it together.

Sign up or log in to comment