E6026

E6026 — A tensor whose element type the target hardware cannot represent, placed on it anyway. The machine model states what a device has (dtypes: [f32, f16, ...]); this is the check that a placement stays inside it. An H100 has no fp4, so an fp4 tensor placed on one asks for silicon that is not there — and the placement is in the type, so the question is answerable here rather than at a kernel launch on the machine that lacks the type. Only fires against a topology that declares dtypes:. An undeclared machine constrains nothing, which is what keeps every machine file written before the field kept working.

What the compiler reports

E6026 … element type f4e2m1 … cannot represent

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// A tensor placed on hardware that cannot represent its element type. E6026.
//
// The machine model already says how much a device holds and what it can reach.
// `dtypes:` says what kinds of value it can hold at all, which is a different
// question and a real hardware boundary: Hopper's tensor cores added fp8 to
// Ampere's set and have no fp4, which arrives with Blackwell. A program that
// places an fp4 tensor on an H100 is asking for silicon that is not there.
//
// Nothing about that needs the program to run. The placement is in the type and
// the machine is a declaration the compiler already reads, so the answer is
// available before a kernel is emitted -- rather than at a launch, on the
// machine that lacks the type, after the job has been scheduled.
//

Memory CPU_DRAM {}
Memory HBM {
  within: Memory::CPU_DRAM, capacity: 80 GiB, managed: explicit, scope: device
}

Topology Hopper {
  arch: nvptx64,
  memory: Memory::HBM,
  visible: [Memory::HBM],
  // Fourth-generation tensor cores: fp8 in both encodings, no fp4.
  dtypes: [f64, f32, bf16, f16, f8e4m3, f8e5m2, i8, u8, bool],
  transfer Memory::CPU_DRAM -> Memory::HBM : 63 GB/s
}

fn main() -> i32 {
  let t = Tensor<f4e2m1, [8, 8]>::uninit();
  let staged = transfer(t, Memory::HBM);
  return 0;
}

From tests/frontend/fail/dtype_not_on_this_machine.vx, which asserts this diagnostic on every commit.

Related