mirror of
https://github.com/ggerganov/llama.cpp
synced 2026-03-03 21:59:44 +01:00
* hexagon: refactor set/get/sum-rows ops to use local context * hexagon: refactor ROPE and Softmax Ops to use local context Improves performance a bit by precomputing things and saving in the context. * hexagon: refactor activation ops to use local context struct * hexagon: refactor unary ops to use local context struct and DMA/VTCM * hexagon: use aligned hvx_scale function * hexagon: remove unused fields from op_context * hexagon: rewrite ROPE to use DMA and VTCM scratchpad * hex-rope: keep N rows in scratchpad (instead of just two) * hex-rope: introduce rowidx cache * hex-rope: remove unused fields * hex-rope: rewrite dma prefetch logic to allow for multi-row fetch/compute also removes the need for fastdiv. * hex-rope: minor formatting * hex-rope: use indices and unroll the loops * hex-rope: more updates to cleanup rope-block handling * hexagon: cleanup supported type/dims checks * hexagon: all reduce funcs replicated across lanes There is no need to explicitly replicate the first value. * snapdragon: update adb and windows scripts to use ubatch-size 256 Updated Ops support handles larger ubatches.
54 lines
1.0 KiB
PowerShell
54 lines
1.0 KiB
PowerShell
|
|
#!/usr/bin/env pwsh
|
|
|
|
# Basedir on device
|
|
$basedir=".\pkg-snapdragon"
|
|
|
|
$cli_opts=$args
|
|
|
|
$model="Llama-3.2-3B-Instruct-Q4_0.gguf"
|
|
if ($null -ne $env:M) {
|
|
$model=$env:M
|
|
}
|
|
|
|
$device="HTP0"
|
|
if ($null -ne $env:D) {
|
|
$device=$env:D
|
|
}
|
|
|
|
if ($null -ne $env:V) {
|
|
$env:GGML_HEXAGON_VERBOSE=$env:V
|
|
}
|
|
|
|
if ($null -ne $env:E) {
|
|
$env:GGML_HEXAGON_EXPERIMENTAL=$env:E
|
|
}
|
|
|
|
if ($null -ne $env:SCHED) {
|
|
$env:GGML_SCHED_DEBUG=$env:SCHED; $cli_opts="$cli_opts -v"
|
|
}
|
|
|
|
if ($null -ne $env:PROF) {
|
|
$env:GGML_HEXAGON_PROFILE=$env:PROF; $env:GGML_HEXAGON_OPSYNC=1
|
|
}
|
|
|
|
if ($null -ne $env:OPMASK) {
|
|
$env:GGML_HEXAGON_OPMASK=$env:OPMASK
|
|
}
|
|
|
|
if ($null -ne $env:NHVX) {
|
|
$env:GGML_HEXAGON_NHVX=$env:NHVX
|
|
}
|
|
|
|
if ($null -ne $env:NDEV) {
|
|
$env:GGML_HEXAGON_NDEV=$env:NDEV
|
|
}
|
|
|
|
$env:ADSP_LIBRARY_PATH="$basedir\lib"
|
|
|
|
& "$basedir\bin\llama-completion.exe" `
|
|
--no-mmap -no-cnv -m $basedir\..\..\gguf\$model `
|
|
--poll 1000 -t 6 --cpu-mask 0xfc --cpu-strict 1 `
|
|
--ctx-size 8192 --ubatch-size 128 -fa on `
|
|
-ngl 99 --device $device $cli_opts
|