A relational attention kernel that reduces evaluated token pairs from O(n²) to O(n·k) — 64.5× at n=1024, 256.5× at n=4096 — verified in simulation, seeking ROCm/HIP collaboration for Phase 3 hardware validation on MI355X

Standard attention evaluates 1,048,576 token pairs at context length 1024. Relational attention evaluates 16,248.

That’s a 64.5× reduction in declared relations — and the ratio grows as context length grows.

At n=4096: 256.5× fewer evaluations. The math is verified. The hardware advantage is Phase 3 — which needs ROCm/HIP on MI355X.

Working simulation, 68/68 tests:

Looking for engineers interested in building the Phase 3 compiled kernel together.

Interesting project. I appreciate that the README distinguishes the 64.5× and 256.5× relation-count reductions from an actual hardware-throughput claim.

From a performance-engineering perspective, it would be helpful to include a reproducibility section for the current Phase 2 results: the CPU/platform used, Python and NumPy versions, benchmark commands, wall-clock results, and a clear separation between mathematically calculated relation counts and measured timings. That would provide a useful baseline before moving to the HIP implementation.

My background is in GPU and systems performance engineering, and I’ve recently been using an MI300X VF on AMD Developer Cloud for ROCm/HIP experiments involving HBM access patterns, GEMM, telemetry, and controlled performance triage. I don’t currently have MI355X access, but I’d be interested in helping with an initial MI300X hardware baseline—correctness, repeatability, timing, scaling across sequence lengths and window sizes, and comparison against the existing attention baseline.

Would MI300X validation be a useful first step, and do you already have a HIP prototype or hardware-validation plan started?

1 Like

The reproducibility split makes sense, especially keeping the mathematical evaluation counts separate from the actual wall-clock measurements. I’d also want the same input sizes, dtypes, batch/context settings, and warm-up policy documented for both the baseline and HIP runs so the comparison doesn’t get distorted by different execution conditions.

For the hardware step, I’d probably start with one MI300X validation pass if that environment is readily available, then use the same benchmark harness on MI355X. That would make it easier to distinguish an algorithmic improvement from gains that are specific to the newer architecture. I’d be interested to see how the kernel behaves as the context length scales, rather than only comparing a single n value.

Krunal, Casey,

Thank you both — this is exactly the kind of scrutiny Phase 2 needed, and I’d like to bring you into the same conversation rather than run two separate threads, since your points build on each other directly.

Krunal, I’ve added a reproducibility section to the README covering the reference environment, benchmark commands, reference output, and wall-clock separation from the theoretical FLOP model.

Casey, your point about pinning down input sizes, dtypes, batch and context settings, and warm-up policy for both the baseline and the HIP runs is a fair extension of that same reproducibility discipline. I’ll fold that into the documentation before any hardware run happens, so the baseline and the comparison stay apples to apples from the start.

On the architecture point — running the same benchmark harness on the MI300X and the MI355X to separate algorithmic gains from generation-specific gains is the right instinct, and it suggests a natural order. Krunal’s proposed MI300X baseline, covering correctness, repeatability, timing, and scaling across sequence lengths and window sizes, would be the first step. Casey’s cross-architecture comparison would follow once that baseline exists and MI355X access is available. Scaling across context length rather than a single value applies to both stages.

On how I’d want to structure this — you two have far more depth than I do in ROCm and HIP execution, memory access patterns, and hardware-specific behavior. That’s exactly the expertise this project needs and doesn’t yet have. My role is to hold the mathematical structure steady, the declared operators, the coherence window, and the admissibility rules that make this relational attention rather than a different windowing heuristic. As the kernel moves from Python reference to a real HIP implementation, there will be points where a hardware-level optimization could quietly change what’s actually being computed. That’s where I’d want to stay closely involved.

Would a short three-way conversation make sense to align on baseline scope, the documentation Casey raised, and sequencing before any hardware time gets spent?

actually, there are some pretty serious flaws in this research, which were pointed out on another forum. I would really love some collaborators, as I’m kinda flying solo here at Metatron Dynamics… We should hold off on any hardware tests until I can properly address the things I missed, but thank you Casey and Krunal for your feedback it was much appreciated :slight_smile: