Skip to content
Open
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

# Only one CUDA-like GPU backend can be enabled at a time.
set(_gpu_backend_count 0)
foreach(_gpu_backend WITH_NVIDIA WITH_ILUVATAR WITH_HYGON WITH_THEAD WITH_METAX WITH_MARS WITH_MOORE WITH_ASCEND)
foreach(_gpu_backend WITH_NVIDIA WITH_ILUVATAR WITH_HYGON WITH_THEAD WITH_METAX WITH_MARS WITH_MOORE WITH_CAMBRICON WITH_ASCEND)
if(${_gpu_backend})
math(EXPR _gpu_backend_count "${_gpu_backend_count} + 1")
endif()
endforeach()

if(_gpu_backend_count GREATER 1)
message(FATAL_ERROR "`WITH_NVIDIA`, `WITH_ILUVATAR`, `WITH_HYGON`, `WITH_THEAD`, `WITH_METAX`, `WITH_MARS`, `WITH_MOORE`, and `WITH_ASCEND` are mutually exclusive. Build one GPU backend at a time.")
message(FATAL_ERROR "GPU backend options are mutually exclusive. Build one GPU backend at a time.")
endif()

if(WITH_NVIDIA)
Expand Down
19 changes: 14 additions & 5 deletions docs/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ backend.
| Mars | `WITH_MARS` | Requires `HPCC_PATH`. |
| Moore | `WITH_MOORE` | Requires `MUSA_ROOT`, `MUSA_HOME`, or `MUSA_PATH`. |
| Hygon | `WITH_HYGON` | Requires DTK and a DTK CUDA toolkit. |
| T-Head | `WITH_THEAD` | Requires a T-Head CUDA-compatible toolkit. |
| Cambricon | `WITH_CAMBRICON` | Requires `NEUWARE_HOME`. |
| Ascend | `WITH_ASCEND` | Requires Ascend toolkit. |

Expand All @@ -27,7 +28,7 @@ All enabled runtime backends provide the core device and memory entry points
needed by the dispatching runtime API. Optional operations may return an error
status on backends that do not support them.

Current test expectations are:
Current runtime test expectations are:

| Backend | Async memcpy | Host memory | Async memory | Memory info | Async memset | Events | Graph capture |
| --- | --- | --- | --- | --- | --- | --- | --- |
Expand All @@ -36,14 +37,22 @@ Current test expectations are:
| Iluvatar | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| MetaX | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Mars | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Moore | Yes | Yes | No | Yes | Yes | Yes | No |
| Hygon | Yes | Yes | Yes | Yes | Yes | Yes | No |
| Cambricon | Yes | No | No | No | No | No | No |
| Ascend | Yes | No | No | No | No | No | Yes |
| Moore | Yes | Yes | No | Yes | Yes | Yes | Yes |
| Hygon | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| T-Head | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Cambricon | Yes | No | No | No | Yes | No | Yes |
| Ascend | Yes | No | No | No | Yes | No | Yes* |

Treat a non-`kSuccess` status as the portable way to detect unsupported
operations.

\* Ascend Graph capture and replay require the runtime `aclmdlRI*` symbols
(`aclmdlRICaptureBegin`, `aclmdlRICaptureGetInfo`, `aclmdlRICaptureEnd`,
`aclmdlRIExecuteAsync`, and `aclmdlRIDestroy`). The Graph replay test is
registered for Ascend builds and passes on CANN 9.0 with 910B hardware. On a
CANN installation without these symbols, the runtime reports Graph capture as
unsupported.

## Header Dependencies

Backend public wrappers may include vendor headers. For example, an NVIDIA
Expand Down
3 changes: 2 additions & 1 deletion src/native/ascend/runtime_.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ struct Runtime<Device::Type::kAscend>

bool Available() const {
return CaptureBegin != nullptr && CaptureGetInfo != nullptr &&
CaptureEnd != nullptr && ExecuteAsync != nullptr;
CaptureEnd != nullptr && ExecuteAsync != nullptr &&
Destroy != nullptr;
}
};

Expand Down
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ if(WITH_ASCEND)
add_infini_rt_backend_runtime_test(
ASCEND infini::rt::Device::Type::kAscend
infini/rt/ascend/runtime_.h
1 0 0 0 0 0 0 0)
1 0 0 0 1 0 0 0)
add_infini_rt_backend_graph_test(
ASCEND infini::rt::Device::Type::kAscend 1)
endif()

if(INFINI_RT_TEST_HAS_RUNTIME_BACKEND)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_native_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ void RunGraphReplayTest(infini::rt::test::TestContext* context) {
"Failed to record device-to-device copy.");
ExpectSuccess(context, runtime::StreamEndCapture(stream, &graph),
"Failed to end stream capture.");
context->Expect(graph != nullptr,
"Stream capture should produce a graph handle.");

ExpectSuccess(context, runtime::GraphInstantiate(&graph_exec, graph),
"Failed to instantiate graph.");
context->Expect(graph_exec != nullptr,
"Graph instantiation should produce an executable handle.");
}

std::array<std::uint8_t, 16> replay_input_1{};
Expand Down
2 changes: 1 addition & 1 deletion tests/test_runtime_dispatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ int main() {

#if defined(INFINI_RT_TEST_WITH_ASCEND)
TestDispatch(&context, infini::rt::Device::Type::kAscend, "ASCEND",
{true, false, false, false, false, false, false, false});
{true, false, false, false, true, false, false, false});
#endif

return context.ExitCode();
Expand Down
Loading