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 declaresdtypes:. An undeclared machine constrains nothing, which is what keeps every machine file written before the field kept working.
What the compiler reports
Error[E6026] at {{.*}}:[[@LINE+1]]:14: this expression has element type f32, which NPU[0] cannot represent; it declares [f16, i32, u32, bool]
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
//
Topology NPU {
memory: Memory::NPU_HBM,
dtypes: [f16, i32, u32, bool]
}
fn main() -> i32 {
spawn on(Topology::NPU[0]) {
let _a = Tensor<f32>([4, 4]);
}
return 0;
}
From tests/frontend/fail/an_f32_tensor_on_an_npu_that_takes_only_f16_is_refused.vx, which asserts this diagnostic on every commit.
Related
Topologies and memoryThe chapter covering the rule this code enforces.
All diagnosticsEvery code the compiler can emit, grouped by stage.
E6025A placement naming a location the machine does not have: a memory space no declared topology holds, written either as the space or as the device that would hold it. The derivation between the two spellings has a like-named fallback, so an undeclared name resolves to a space that exists only in the placement that mentions it. A placement, a
spawn on or an on clause also gets this error when it names a device that a declared topology does not have: X[2] when X has count: 2, or a bare X when X has more than one device. Each device of such a topology has its own copy of its memory. So a placement or a transfer that names that memory alone gets this error too: it does not say which copy. Name the device instead, as in transfer(x, Topology::X[1]).
E6027A working set that overflows a space only across call boundaries: the peak along some call path — what each caller still holds when it calls, plus the deepest callee's own peak — exceeds the space's declared capacity, while every function on the path fits by itself (that case is E6010's). Computed by folding per-function capacity summaries over the call graph, after the per-function checks. Downgraded to W1028 when the space is declared overcommit.