Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion csrc/device_lower/analysis/device_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
// clang-format on
#include <cuda.h>

#include <device_lower/analysis/device_version.h>
#include <device_lower/lower2device.h>
#include <mma_type.h>
Expand All @@ -19,9 +21,22 @@ void MinimumDeviceVersion::dispatch(Val* val) {
}
if (val->dtype() == DataType::Float8_e4m3fn ||
val->dtype() == DataType::Float8_e5m2) {
// See release note
// https://docs.nvidia.com/cuda/archive/12.1.0/parallel-thread-execution/index.html#ptx-isa-version-8-1
#if (CUDA_VERSION >= 12010)
ensureVersion(
{9, 0},
{8, 9},
"Fusion contains Float8_xxx values which was introduced in Ada (8.9)");
// See release note
// https://docs.nvidia.com/cuda/archive/11.8.0/parallel-thread-execution/index.html#ptx-isa-version-7-8
#elif (CUDA_VERSION >= 11080)
ensureVersion(
{8, 9},
"Fusion contains Float8_xxx values which was introduced in Hopper (9.0)");
#else
NVF_ERROR(
"Fusion contains Float8_xxx values which was not supported in given CUDA version");
#endif // (CUDA_VERSION >= 12010)
}
IterVisitor::dispatch(val);
}
Expand Down
10 changes: 7 additions & 3 deletions tests/cpp/test_gpu1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2711,13 +2711,17 @@ TEST_F(NVFuserTest, FusionFp8CastOps_CUDA) {
std::vector<c10::IValue> inputs = {input1};

KernelExecutor ke;

#if (CUDA_VERSION >= 12010)
if (!deviceMajorMinorCheck(8, 9)) {
#elif (CUDA_VERSION >= 11080)
if (!deviceMajorMinorCheck(9)) {
#else
if (true) {
#endif
ASSERT_THAT(
[&]() { ke.compile(&fusion, inputs); },
testing::ThrowsMessage<nvfuser::nvfError>(testing::HasSubstr(
"Reason: Fusion contains Float8_xxx values which was introduced in Hopper (9.0)")));
GTEST_SKIP() << "skipping tests on pre-HOPPER GPUs";
"Reason: Fusion contains Float8_xxx values")));
} else {
ke.compile(&fusion, inputs);
auto outputs = ke.run(inputs);
Expand Down