Skip to content

Commit 19033e2

Browse files
fix windows build issue
1 parent ecb0042 commit 19033e2

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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

extension/llm/custom_ops/sdpa_with_kv_cache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# pyre-unsafe
1212

13+
import os
1314
import logging
1415
from pathlib import Path
1516

@@ -24,7 +25,11 @@
2425
op2 = torch.ops.llama.fast_hadamard_transform.default
2526
assert op2 is not None
2627
except:
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])

extension/llm/runner/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ET_EXPERIMENTAL void inline safe_printf(const char* piece) {
4444
ET_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

0 commit comments

Comments
 (0)