CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
61 lines
2.5 KiB
C
61 lines
2.5 KiB
C
/******************************************************************************
|
||
* Copyright (c) 2026, Advanced Micro Devices, Inc. All rights reserved.
|
||
*
|
||
* SPDX-License-Identifier: MIT
|
||
*****************************************************************************/
|
||
|
||
#ifndef GIN_ANVIL_SDMA_FACTORY_H_
|
||
#define GIN_ANVIL_SDMA_FACTORY_H_
|
||
|
||
#include <stddef.h>
|
||
#include <stdint.h>
|
||
|
||
#define GIN_ANVIL_SDMA_API __attribute__((visibility("default")))
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
/**
|
||
* Opaque handle: standalone SDMA queue table (per local peer × channels) +
|
||
* sdmaDirty bitmask. Independent of PGAS runtime init; uses AnvilLib device paths.
|
||
*/
|
||
typedef struct gin_anvil_sdma_opaque* gin_anvil_sdma_handle_t;
|
||
|
||
/** @return 1 if SDMA Anvil path is compiled in and HIP reports at least one device, else 0 */
|
||
GIN_ANVIL_SDMA_API int gin_anvil_sdma_probe(void);
|
||
|
||
/**
|
||
* Bootstrap allgather: int allgather(void* ctx, void* buf, size_t bytes_per_rank)
|
||
* Each rank fills buf[myRank * elem_size ..] before the collective; result is full table.
|
||
*
|
||
* On entry, `buf` must point to `nRanks * sizeof(int)` bytes. The caller sets
|
||
* `buf[myRank] = my_device_id` before invoking `allgather`; after the collective,
|
||
* `buf[r]` is the HIP device ordinal for rank `r`.
|
||
*
|
||
* @param my_device_id HIP ordinal for this rank (typically hipGetDevice).
|
||
* @param num_channels SDMA channels per peer pair (clamped to [1,8]).
|
||
* @param out_gpu_handles Device pointer to array of nRanks*num_channels pointers to
|
||
* SdmaQueueDeviceHandle (layout: local_pe * num_channels + ch).
|
||
* @param out_sdma_dirty Device pointer to a single uint64_t dirty bitmask (device memory).
|
||
*/
|
||
GIN_ANVIL_SDMA_API int gin_anvil_sdma_create(
|
||
int nRanks, int myRank, int my_device_id,
|
||
int (*allgather)(void* ctx, void* buf, size_t bytes_per_rank), void* allgather_ctx,
|
||
int num_channels, gin_anvil_sdma_handle_t* out_handle, void** out_gpu_handles,
|
||
uint64_t** out_sdma_dirty);
|
||
|
||
GIN_ANVIL_SDMA_API void gin_anvil_sdma_destroy(gin_anvil_sdma_handle_t handle);
|
||
|
||
/** Fields stored in the opaque handle for RCCL plugin / device code */
|
||
GIN_ANVIL_SDMA_API int gin_anvil_sdma_get_n_ranks(gin_anvil_sdma_handle_t handle);
|
||
GIN_ANVIL_SDMA_API int gin_anvil_sdma_get_num_channels(gin_anvil_sdma_handle_t handle);
|
||
/** 1 = spread wavefronts across channels (NCCL_GIN_ANVIL_SDMA_SPREAD_CHANNELS, default on) */
|
||
GIN_ANVIL_SDMA_API int gin_anvil_sdma_get_channel_stride(gin_anvil_sdma_handle_t handle);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
#endif // GIN_ANVIL_SDMA_FACTORY_H_
|