Source/Packages

Model.Architecture

packages/components/src/Model/Architecture.alpha

91 lines37 declarations2.8 KiBSHA-256 e8182f753683

Complete file · line 1

Architecture.alpha

Definition view
1module Model.Architecture
2
3import Model.Config
4import Model.Word32
5
6-- Hardware-free model-architecture contract shared by named systems. Concrete
7-- configurations live with their systems: Model.AlphaER owns the historical
8-- Alpha-ER configuration and Coppelius.Model owns Coppelius. Keeping only the
9-- contract here prevents either runnable system from depending on the other.
10family ModelPositionEncoding : Type 0
11constructor ModelLearnedPositions
12constructor ModelRotaryPositions
13
14end-family
15
16family ModelNormKind : Type 0
17constructor ModelLayerNormalization
18constructor ModelRMSNormalization
19
20end-family
21
22family ModelRouteKind : Type 0
23constructor ModelPositionRoute
24constructor ModelCyclicRoute
25constructor ModelTokenHashRoute
26
27end-family
28
29family ModelOptionalWord32 : Type 0
30constructor ModelNoWord32
31constructor ModelSomeWord32
32field unrestricted modelSomeWord32Value : (family ModelWord32)
33
34end-family
35
36family ModelObjective : Type 0
37constructor ModelExactVocabulary
38constructor ModelSampledVocabulary
39field unrestricted modelSampledNegativeCount : (family ModelWord32)
40
41end-family
42
43family ModelConfig : Type 0
44constructor ModelConfigValue
45field unrestricted modelVocabSize : (family ModelWord32)
46field unrestricted modelBlockSize : (family ModelWord32)
47field unrestricted modelLayers : (family ModelWord32)
48field unrestricted modelWidth : (family ModelWord32)
49field unrestricted modelHeads : (family ModelWord32)
50field unrestricted modelFfnStoredWidth : (family ModelWord32)
51field unrestricted modelExperts : (family ModelWord32)
52field unrestricted modelTopK : (family ModelWord32)
53field unrestricted modelRoute : (family ModelRouteKind)
54field unrestricted modelStackedExperts : (family ModelBoolean)
55field unrestricted modelHeadRank : (family ModelOptionalWord32)
56field unrestricted modelAttentionRank : (family ModelOptionalWord32)
57field unrestricted modelPositionEncoding : (family ModelPositionEncoding)
58field unrestricted modelNormKind : (family ModelNormKind)
59field unrestricted modelTieEmbeddings : (family ModelBoolean)
60field unrestricted modelObjective : (family ModelObjective)
61
62end-family
63
64-- Field projection for `modelBlockSize`, generated from the declaration: the family
65-- has one constructor, so this is the unique total projection.
66def modelBlockSize =
67  (lambda unrestricted value : (family ModelConfig) .
68    (eliminate
69      ModelConfig
70      (lambda unrestricted current : (family ModelConfig) . (family ModelWord32))
71      value
72      (branch
73        ModelConfigValue
74        modelVocabSize
75        modelBlockSize
76        modelLayers
77        modelWidth
78        modelHeads
79        modelFfnStoredWidth
80        modelExperts
81        modelTopK
82        modelRoute
83        modelStackedExperts
84        modelHeadRank
85        modelAttentionRank
86        modelPositionEncoding
87        modelNormKind
88        modelTieEmbeddings
89        modelObjective
90        .
91        modelBlockSize)))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.