File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ rem Install snakeviz for cProfile flamegraph
2+ rem Install sentencepiece for llama tokenizer
3+ pip install snakeviz sentencepiece
4+
5+ rem Install torchao.
6+ pip install " %~dp0 /../../../third-party/ao"
7+
8+ rem Install lm-eval for Model Evaluation with lm-evalution-harness
9+ rem Install tiktoken for tokenizer
10+ pip install lm_eval== 0.4.5
11+ pip install tiktoken blobfile
12+ rem Restore numpy if > = 2.0
13+ pip install " numpy<2.0"
14+
15+ rem Call the install helper for further setup
16+ python examples/models/llama/install_requirement_helper.py
Original file line number Diff line number Diff line change 1010
1111# pyre-unsafe
1212
13+ import os
1314import logging
1415from pathlib import Path
1516
2425 op2 = torch .ops .llama .fast_hadamard_transform .default
2526 assert op2 is not None
2627except :
27- libs = list (Path (__file__ ).parent .resolve ().glob ("libcustom_ops_aot_lib.*" ))
28+ lib_name_pattern = "libcustom_ops_aot_lib.*"
29+ if os .name == "nt" :
30+ lib_name_pattern = "custom_ops_aot_lib.*"
31+
32+ libs = list (Path (__file__ ).parent .resolve ().glob (lib_name_pattern ))
2833 assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
2934 logging .info (f"Loading custom ops library: { libs [0 ]} " )
3035 torch .ops .load_library (libs [0 ])
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ ET_EXPERIMENTAL void inline safe_printf(const char* piece) {
4444ET_EXPERIMENTAL long inline time_in_ms () {
4545 // return time in milliseconds, for benchmarking the model speed
4646 struct timespec time;
47- clock_gettime (CLOCK_REALTIME, &time);
47+ timespec_get ( &time, TIME_UTC );
4848 return time.tv_sec * 1000 + time.tv_nsec / 1000000 ;
4949}
5050
You can’t perform that action at this time.
0 commit comments