[Core] M0 foundation: workspace, Lean 4 SlabRing/PrefixState contracts, checked safetensors/cache IO, serve proto, telemetry, and HIP ABI

This commit is contained in:
adm committed 2026-11-29 21:32:44 +01:00
commit 63b1668a92
25 files changed
+2991

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
// kernels/hip/vetta_kernels.h
// Minimal C ABI for the <15 reusable RDNA 3.5 (gfx1150) HIP microkernels shared across all MoE models.
#pragma once
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void* vetta_stream_t;
typedef void* vetta_event_t;
typedef struct vetta_device_info_t {
char name[128];
char gcn_arch[64];
int multi_processor_count;
int wave_size;
uint64_t total_vram_bytes;
int is_uma;
} vetta_device_info_t;
// Runtime & UMA zero-copy buffer lifecycle (Milestone 1+)
int vetta_hip_query_device(int dev_id, vetta_device_info_t* out_info);
int vetta_hip_register_uma_pages(void* host_aligned_ptr, size_t bytes, void** out_dev_ptr);
int vetta_hip_unregister_uma_pages(void* host_aligned_ptr);
// Core <15 microkernel entry points (implemented progressively in M1 & M2):
// 1. k_embed_bf16
// 2. k_rms_norm
// 3. k_quantize_x_g64
// 4. k_gemm_q8_g64_t16
// 5. k_gemm_q4_g64_t16 (SWAR 3-inst INT4->INT8 WMMA)
// 6. k_gemm_nvfp4_mxfp8
// 7. k_rope_kv_write
// 8. k_flash_gqa_wmma
// 9. k_gdn_chunkwise_wy (WY-representation parallel prefill)
// 10. k_gdn_recurrent_step (0-spill decode + rollback history)
// 11. k_moe_route_bucket (100% GPU routing + bitonic coreset + NaN/mask safety)
// 12. k_moe_grouped_wmma (compacted w13 fused SwiGLU+quantize & w2 + reduce)
// 13. k_vit_flash_attn_wmma (64x64 FP16 WMMA Vision)
// 14. k_gpu_penalties_topk (GPU penalties + top-64 extraction, <=512 B D2H/row)
#ifdef __cplusplus
}
#endif