このページは、このリリースではまだ翻訳されていません。英語版が正式版です。 英語版を見る →

GPU プログラミング

チェックイン済み GPU artifact、検証済み構文、attested 状態。

GPU プログラミング

このリポジトリの現在のスナップショットには、2つのチェックイン済み compiler profile があります。

  • souc-linux-x86_64: 既定の native profile
  • souc-linux-x86_64-gpu: 公開 GPU profile

Self-hosted GPU パス

既定の self-hosted compiler (bin/souc) は GPU kernel 構文を受け付け、kretikos から定義済み artifact template を出力できます:

# 定義済み vec_add PTX template を出力
kretikos emit-ptx vec_add     -o /tmp/kernel.ptx
kretikos emit-ptx vec_sub     -o /tmp/kernel.ptx
kretikos emit-ptx vec_mul     -o /tmp/kernel.ptx
kretikos emit-ptx vec_div     -o /tmp/kernel.ptx
kretikos emit-ptx vec_add_f64 -o /tmp/kernel.ptx
kretikos emit-ptx fma         -o /tmp/kernel.ptx

kretikos emit-metal vec_add          -o /tmp/kernel.metal
kretikos emit-metal ossm_oct_step    -o /tmp/kernel.metal
kretikos emit-metal sedenion_cd_step -o /tmp/kernel.metal

# 定義済み vec_add_f32 CUBIN template を出力
kretikos emit-cubin vec_add_f32 -o /tmp/kernel.cubin

# PTX+CUBIN と structural bundle manifest を出力
kretikos bundle -o /tmp/kretikos-bundle

現在確認済みの内容

export SOUC_GPU_BIN="$(pwd)/artifacts/omega/souc-bin/souc-linux-x86_64-gpu"
export SOUNIO_STDLIB_PATH="$(pwd)/stdlib"

"$SOUC_GPU_BIN" info
"$SOUC_GPU_BIN" check examples/gpu.sio
"$SOUC_GPU_BIN" check tests/run-pass/gpu_launch_surface.sio
"$SOUC_GPU_BIN" build examples/kernel_matmul.sio --backend gpu -o /tmp/kernel_matmul.ptx

この時点で確認できる事実:

  • チェックイン済み GPU artifact では GPU codegen が有効です。
  • 公開 PTX 出力経路は build --backend gpu です。
  • kernel fnwith GPUGPU.launchGPU.sync はその GPU profile で受理されます。

現在の公開 surface

現在公開かつ検証済み:

  • kernel fn
  • with GPU
  • perform GPU.launch(...)
  • perform GPU.sync()
  • build --backend gpu による PTX 出力

まだチェックイン済み公開 surface ではないもの:

  • gpu.thread_id.*
  • gpu.block_id.*
  • gpu.block_dim.*
  • gpu.alloc<T>(...)

Backend の証拠

強い証拠は artifacts/omega/ にあります:

  • gpu_codegen_parity.v1.json
  • gpu_binary_attestation.v1.json
  • gpu_runtime_attest_gate.v1.json
  • gpu_public_contract.v1.json

現在 attested な compute lanes:

  • CUDA: cuda-sm80
  • ROCm: rocm-gfx942