interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / mk / attention-mirror.mk

20 lines · 1511 bytes Raw Blame History
1# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2CARRIED_HOST_TESTS += test-attention-mirror-policy
3.PHONY: test-attention-mirror-policy
4$(OUT_DIR)/attention-mirror-policy.so: src/cudapp_om_attn_mirror_plan.c src/cudapp_om_attn_mirror_step.c
5 @mkdir -p $(OUT_DIR)
6 $(CC) $(filter-out -MMD -MP,$(CFLAGS)) -shared -fPIC $^ -o $@
7test-attention-mirror-policy: $(OUT_DIR)/attention-mirror-policy.so
8 python3 om/attention-mirror/check.py $(abspath $(OUT_DIR))/attention-mirror-policy.so
9ifeq ($(CUDAPP_OMC_HOST),1)
10 OMEGA_OMC="$(OMEGA_OMC)" OMEGA_BRIDGE="$(OMEGA_BRIDGE)" CC="$(CC)" python3 om/attention-mirror/mutants.py
11endif
12
13CARRIED_HOST_TESTS += test-attention-mirror-dispatch
14.PHONY: test-attention-mirror-dispatch
15ATTN_MIRROR_WRAP = omega_gpu_session_lock omega_gpu_session_unlock omega_gpu_session_open omega_gpu_session_on_close omega_gpu_decode_attn256_cache_view omega_gpu_session_sync_to_gpu omega_gpu_session_sync_to_cpu omega_gpu_session_free omega_gpu_pf_alloc_dev_locked omega_gpu_pf_copy_va_locked omega_gpu_session_launch
16$(OUT_DIR)/attention-mirror-dispatch: om/attention-mirror/dispatch-check.c src/omega_gpu_prefill_attn256_api.c $(OUT_DIR)/libomega_gpu.a
17 $(CC) $(CFLAGS) -o $@ $< $(OUT_DIR)/libomega_gpu.a $(foreach f,$(ATTN_MIRROR_WRAP),-Wl,--wrap=$(f)) -lpthread -lm
18test-attention-mirror-dispatch: $(OUT_DIR)/attention-mirror-dispatch
19 $(abspath $(OUT_DIR))/attention-mirror-dispatch
20 CC="$(CC)" python3 om/attention-mirror/dispatch-mutants.py $(abspath $(OUT_DIR))/libomega_gpu.a