Skip to content

Commit a61a109

Browse files
authored
Merge pull request #1 from mikepapadim/feat/improve_timer_verbose
Improve timer loging for init
2 parents 4e719f5 + 98dda0d commit a61a109

File tree

5 files changed

+322
-317
lines changed

5 files changed

+322
-317
lines changed

llama-tornado

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ class LlamaRunner:
7373
if args.use_gpu:
7474
cmd.append("-Duse.tornadovm=true")
7575

76+
if args.verbose_init:
77+
cmd.append("-Dllama.EnableTimingForTornadoVMInit=true")
78+
7679
# Debug options
7780
debug_config = []
7881

@@ -289,6 +292,9 @@ def create_parser() -> argparse.ArgumentParser:
289292
help="Print kernel information (tornado.printKernel=true)")
290293
verbose_group.add_argument("--full-dump", dest="full_dump", action="store_true",
291294
help="Enable full debug dump (tornado.fullDebug=true)")
295+
verbose_group.add_argument("--verbose-init", dest="verbose_init", action="store_true",
296+
help="Enable timers for TornadoVM initialization (llama.EnableTimingForTornadoVMInit=true)")
297+
292298

293299
# Command display options
294300
command_group = parser.add_argument_group("Command Display Options")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static Weights loadWeights(Map<String, GGMLTensorEntry> tensorEntries, Co
8989
GGMLTensorEntry outputWeight = tensorEntries.getOrDefault("output.weight", tokenEmbeddings);
9090

9191
if (LlamaApp.USE_TORNADOVM) {
92-
System.out.println("Loading weights in TornadoVM format");
92+
System.out.println("Loading model weights in TornadoVM format (converting " + outputWeight.ggmlType() + " -> " + GGMLType.F16 + ")");
9393
return createTornadoVMWeights(tensorEntries, config, ropeFreqs, tokenEmbeddings, outputWeight);
9494
} else {
9595
return createStandardWeights(tensorEntries, config, ropeFreqs, tokenEmbeddings, outputWeight);

0 commit comments

Comments
 (0)