Skip to content

Commit 16f5114

Browse files
Finalize review comments
1 parent 04ba434 commit 16f5114

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

src/main/java/com/example/model/Configuration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public interface Configuration {
3434
/** Base value for RoPE (Rotary Position Embedding) calculations */
3535
float ropeTheta();
3636

37-
/** Size of each attention head (derived from dim / numberOfHeads) */
3837
int headSize();
3938

4039
int kvDim();

src/main/java/com/example/model/llama/LlamaConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public int contextLengthModel() {
1515
throw new UnsupportedOperationException("Not supported for Llama.");
1616
}
1717

18+
/** Size of each attention head (derived from dim / numberOfHeads) */
1819
public int headSize() {
1920
return dim / numberOfHeads;
2021
}

src/main/java/com/example/model/loader/ModelLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public abstract class ModelLoader {
3838
private static final String TOKENIZER_MISTRAL_MODEL = "llama";
3939

4040
protected FileChannel fileChannel;
41-
GGUF gguf;
42-
int contextLength;
43-
boolean loadWeights;
41+
protected GGUF gguf;
42+
protected int contextLength;
43+
protected boolean loadWeights;
4444

4545
public ModelLoader(FileChannel fileChannel, GGUF gguf, int contextLength, boolean loadWeights) {
4646
this.fileChannel = fileChannel;

src/main/java/com/example/tornadovm/Qwen3TornadoVMLayerPlanner.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
public class Qwen3TornadoVMLayerPlanner extends TornadoVMLayerPlanner<Qwen3State, Qwen3Configuration, Qwen3TornadoWeights> {
2020

21-
int nHeadKv;
22-
int nEmbdHeadK;
23-
int nEmbdHeadV;
24-
int nEmbdVGqa;
25-
int nEmbdHead;
26-
int nEmbdGqa;
27-
int gqa;
28-
float sqrtHeadSize;
21+
private final int nHeadKv;
22+
private final int nEmbdHeadK;
23+
private final int nEmbdHeadV;
24+
private final int nEmbdVGqa;
25+
private final int nEmbdHead;
26+
private final int nEmbdGqa;
27+
private final int gqa;
2928

3029
public Qwen3TornadoVMLayerPlanner(Qwen3State state, Model model) {
3130
super(state, model);
@@ -37,7 +36,6 @@ public Qwen3TornadoVMLayerPlanner(Qwen3State state, Model model) {
3736
this.nEmbdHead = nEmbdHeadV;
3837
this.nEmbdGqa = nEmbdVGqa;
3938
this.gqa = config.numberOfHeads() / config.numberOfKeyValueHeads(); // integer multiplier of the kv sharing in multiquery
40-
this.sqrtHeadSize = (float) Math.sqrt(nEmbdHead);
4139
}
4240

4341
// @formatter:off

0 commit comments

Comments
 (0)