Skip to content

Commit 6b30094

Browse files
Fix lint errors and update llama sample run script
1 parent 6491161 commit 6b30094

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

backends/mediatek/runtime/NeuronBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ Error NeuronExecuTorchDelegate::execute(
169169

170170
PrepareInputsOuputs(args);
171171

172-
auto allocator = dynamic_cast<neuron::BufferAllocator*>(
173-
context.get_temp_allocator());
172+
auto allocator =
173+
dynamic_cast<neuron::BufferAllocator*>(context.get_temp_allocator());
174174

175175
size_t inputCount = mInputSizes.size() + neuron_shared_weights_.size();
176176
size_t outputCount = mOutputSizes.size();

examples/mediatek/executor_runner/llama_runner/LlamaModelChunk.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ std::string LlamaModelChunk::SelectMethod(
8383
return methodName;
8484
}
8585
}
86-
ET_LOG(Error, "Unable to find suitable method, fallback to use the first method.");
86+
ET_LOG(
87+
Error,
88+
"Unable to find suitable method, fallback to use the first method.");
8789
return {};
8890
}
8991

examples/mediatek/executor_runner/mtk_llama_executor_runner.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,11 @@ DEFINE_string(
6666
token_embedding_path,
6767
"embedding.bin",
6868
"Input token embedding lookup table path.");
69-
DEFINE_string(
70-
prompt_model_paths,
71-
"model_128t.pte",
72-
"Comma-separated prompt model paths.");
73-
DEFINE_string(
74-
gen_model_paths,
75-
"model_1t.pte",
76-
"Comma-separated generative model paths.");
69+
DEFINE_string(prompt_model_paths, "", "Comma-separated prompt model paths.");
70+
DEFINE_string(gen_model_paths, "", "Comma-separated generative model paths.");
7771
DEFINE_string(
7872
model_package_paths,
79-
"model_package.pte",
73+
"",
8074
"Comma-separated weight-shared model package paths.");
8175

8276
// Tokenizer

examples/mediatek/executor_runner/run_llama3_sample.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,12 @@ TOKENIZER_PATH="/data/local/tmp/llama3/tokenizer.model"
3636
TOKEN_EMBEDDING_PATH="/data/local/tmp/llama3/embedding_llama3_8b_instruct_fp32.bin"
3737

3838
# Comma-Separated Paths
39-
PROMPT_MODEL_PATHS="\
40-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_128t512c_0.pte,\
41-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_128t512c_1.pte,\
42-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_128t512c_2.pte,\
43-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_128t512c_3.pte,"
44-
45-
# Comma-Separated Paths
46-
GEN_MODEL_PATHS="\
47-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_1t512c_0.pte,\
48-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_1t512c_1.pte,\
49-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_1t512c_2.pte,\
50-
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_1t512c_3.pte,"
39+
WEIGHT_SHARED_MODEL_PACKAGE_PATHS="\
40+
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_0.pte,\
41+
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_1.pte,\
42+
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_2.pte,\
43+
/data/local/tmp/llama3/llama3_8b_SC_sym4W_sym16A_4_chunks_Overall_3.pte,\
44+
"
5145

5246
PROMPT_FILE=/data/local/tmp/llama3/sample_prompt.txt
5347

@@ -75,6 +69,5 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
7569
--tokenizer_type=$TOKENIZER_TYPE \
7670
--tokenizer_path=$TOKENIZER_PATH \
7771
--token_embedding_path=$TOKEN_EMBEDDING_PATH \
78-
--prompt_model_paths=$PROMPT_MODEL_PATHS \
79-
--gen_model_paths=$GEN_MODEL_PATHS \
72+
--model_package_paths=$WEIGHT_SHARED_MODEL_PACKAGE_PATHS \
8073
--prompt_file=$PROMPT_FILE

0 commit comments

Comments
 (0)