Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 committed Jun 5, 2024
1 parent 2a02de9 commit f79e64f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/target/source/codegen_cuda.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ void CodeGenCUDA::PrintType(DataType t, std::ostream& os) { // NOLINT(*)
if (!fail) return;
} else if (t.is_float8()) {
enable_fp8_ = true;
os << GetFP8Type(t);
if (t.lanes() <= 4) {
os << GetFP8Type(t);
} else {
os << "uint" << t.lanes() / 4;
}
return;
} else if (t == DataType::Bool()) {
os << "bool";
Expand Down
2 changes: 1 addition & 1 deletion tests/python/codegen/test_target_codegen_cuda_fp8.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def add(
fadd = tvm.build(sch.mod, target=target)

cuda_src = fadd.imported_modules[0].get_source()
assert "fp8_e4_t" in cuda_src, "FP8E4M3 (fp8_e4_t) datatype not found in generated CUDA"
assert "__nv_fp8_e4m3" in cuda_src, "FP8E4M3 (fp8_e4_t) datatype not found in generated CUDA"

dev = tvm.device(target, 0)

Expand Down

0 comments on commit f79e64f

Please sign in to comment.