interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / src / tensor / omega_tensor_gb10.om

65 lines · 1340 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note omega_tensor_gb10.om -- Pure seeded OM-2 GB10 realization descriptor and op-mapping table.
3note Refuses unmapped ops with OMEGA_NUMERIC_ERR_NOT_ENCODED (-4) before opening any device.
4note No silent CPU fallback.
5
6const OT_GB10_ERR_NOT_ENCODED long -4
7const OT_GB10_ERR_BAD_ARGS long -1
8const OT_GB10_ERR_OPERANDS long -2
9const OT_GB10_REDUCE_MAX_N ulong 32768
10
11note Returns E1 GB10 SIMT op id (>= 1) if encoded on GB10, or 0 if refused.
12fn ot_gb10_simt_op_id op ulong to ulong
13 if le op OT_TB_SEL_NEU
14 ret add op 1
15 end
16 ret 0
17end
18
19note Returns E1 row-10 transc kernel id (0..10) if encoded on GB10, or -1 if refused.
20fn ot_gb10_transc_kernel op ulong to long
21 if eq op OT_TU_EXP2
22 ret 0
23 end
24 if eq op OT_TU_LOG2
25 ret 1
26 end
27 if eq op OT_TU_SIGMOID
28 ret 2
29 end
30 if eq op OT_TU_TANH
31 ret 3
32 end
33 if eq op OT_TU_SIN
34 ret 4
35 end
36 if eq op OT_TU_COS
37 ret 5
38 end
39 if eq op OT_TU_ERF
40 ret 6
41 end
42 if eq op OT_TU_GELU
43 ret 7
44 end
45 if eq op OT_TU_RSQRT
46 ret 8
47 end
48 if eq op OT_TU_EXP
49 ret 9
50 end
51 if eq op OT_TU_LOG
52 ret 10
53 end
54 ret -1
55end
56
57fn ot_gb10_check_reduce op ulong n ulong to long
58 if gt n OT_GB10_REDUCE_MAX_N
59 ret OT_GB10_ERR_OPERANDS
60 end
61 if or ge op OT_TR_COUNT eq n 0
62 ret OT_GB10_ERR_BAD_ARGS
63 end
64 ret 0
65end