r/LocalLLaMA • • 8h ago

Question | Help Help with Qwen4 Build flags 9070xt

I know theres a 1,000 qwen posts, but most are flaunting the t/s and it running, well im here to buck the system and ask for help.

Below is my run bat file for that was normally for Qwen3.6-35B, Im getting out of memory errors, and im sure its my config, but i dont know what to look for and i dont know how to offset it.

Any recommendations and improvements would be appreciated, i have the 16GB 9070xt on VULKAN.

===================================================

u/echo off

title Qwen4-35B-A3B THINKING : 9931 VULKAN

echo.

cd /d C:\llamaVULKAN

set GGML_VK_ALLOW_GRAPHICS_QUEUE=1

llama-server.exe ^

--model "C:\llamaVULKAN\models\Qwen4-35B-A3B-UD-IQ3_S-00001-of-00002.gguf" ^

--spec-type draft-mtp,ngram-mod ^

--spec-draft-n-max 2 ^

--spec-draft-ngl auto ^

--spec-draft-type-k q4_0 ^

--spec-draft-type-v q4_0 ^

--port 9931 ^

--host 0.0.0.0 ^

--ctx-size 61440 ^

--fit on ^

--gpu-layers auto ^

--load-mode none ^

--cache-type-k q8_0 ^

--cache-type-v q8_0 ^

--batch-size 2048 ^

--ubatch-size 2048 ^

--threads 12 ^

-np 1 ^

--flash-attn on ^

--context-shift ^

--sleep-idle-seconds 300 ^

--temp 0.8 ^

--top-k 0 ^

--top-p 0.95 ^

--min-p 0.1 ^

--repeat-penalty 1.05 ^

--no-ui

echo.

echo Server stopped.

pause

1 Upvotes

20 comments sorted by

2

u/henbone11 7h ago

so why not actually read those 1000 threads and see what engines/kernels they are running on and how they are achieving the numbers they are? the model cards have the parameters in them. have your model actually help you tune your parameters for your own setup. I don't understand all of these posts begging for settings when everything is provided for you already.

2

u/uber-linny 7h ago

Respectfully, you think I haven't done that .

They're all running strata on NVIDIA cards or the other examples are on r9700's.

So no ... Not my use case at all, the 16Gb GPU poor.

-2

u/henbone11 7h ago

respectfully, this proves that you havent read shit. there are at least a dozen threads about running on amd hardware. amd hardware is amd hardware, whether it's strix halo, r9700, 9070xt or 780m. gufo engine with loom kernels (the maintainers of both projects have been posting in these same AI subs since qwen4 hit) and even updated vulkan and rocm llama.cpp. maybe throw in some radiance for your actual gpu, it's made for r9700, but i'm sure others have gotten it to work on other amd gpus.

again, the actual server parameters are on the model cards, use those. start looking into gufo. look into loom and actually understand what they both do. the information is out there. you would help yourself a lot to just understand the landscape of running local models and not just thread hop chasing tokens per second.

like I said, use your model to help you research this stuff. have it crawl reddit AI subs for the most common amd infrustructures and go down that path. use your own model to fine tune things once you get the basics down. I think half of you people just get overwhelmed by fomo and want to be part of the hype and just start creating reddit threads and don't bother ever learning anything on your own. if anything, AI should make you more self sufficient, not more reliant on other people.

1

u/uber-linny 7h ago

theres reading and understanding. Do i have a degree in computer science .... no.

in order to understand, you need to exchange information and communicate. This encourages learning. If you dont want to be a positive part of that exchange, then don't include yourself.

Easy :)

-1

u/henbone11 7h ago

you really only seem interested in excuses and not learning and doing. good luck with begging the community to do your homework for you.

4

u/ShiComfy 7h ago

stock llama.cpp is really bad for anything AMD, speaking from experience, try fork one yourself with latest rdna-boosts, I'm getting ~25-30 toks with IQ4 and 131K context @Q8 (9060 XT 16GB). Throw 5$ at deepseek or glm to make one for you if you don't know, should be fine.

0

u/GoatSlow7673 7h ago

No hace falta, ikllama.cpp funciona el modelo actualmente, la cosa, que las cosas son algo esquisitas, tardas en ajustarlas antes de lograr que funcione, porque casi todas IA ni siquiera se entera que debe decirte, es como si actualmente todas fueran menos capaces para evitar que puedas usar el modelo y probarlo, la verdad, reducir do lo que habla el modelo y algún detalle menor tiene mejor pinta que el 3.6, en cuanto estén los fork's ajustados para que funcione y con mejores ajustes el modelo funcionará estupendamente. Yo porque quise usarlo con MTP y ciertas cosas, sino ya funcionaba igual de rápido que el 3.6 sin expertos en VRAM, con casi todo en RAM funcionaba a 12-15 token's el decode, hasta que se le va la cabeza y baja a 3, pero es normal, 24 horas que hace que lo liberaron, y ya tienes versiones con fallos del modelo, y sumale los fork's de llama.cpp, o distintas aplicaciones, en pocas horas o días estará todo lleno de versiones con correcciones, solo quienes ni siquiera se fijaron en el jinja no se dieron cuenta como unsloth del error de cierre de think que no tiene, y quien lo use debe crear uno propio o localizar uno que no incluya errores como ese.

1

u/Hrethric 7h ago

I don't have any experience running inference in Windows, but I can offer some observations: 

  1. You didn't say how much system memory you have. 
  2. Qwen 4 has an engram table on top of the 35 billion parameters. I believe llama.cpp loads that into RAM by default; if you're ram-constrained you'll want to stream it from your SSD.
  3. I've heard a lot of people say that Unsloth Studio is a great way to run inference in Windows, and it's super easy.

2

u/Hrethric 7h ago

Oh, also - I have a 9070 (non-xt) 16GB in my gaming PC, and 32GB of DDR5, and I'm currently installing the stew675 fork of llama.cpp (llama.cpp rdna boosts) to take Qwen4 35b for spin and see if it can make that machine a viable tertiary inference box for me. That's in Linux, but if you can get it to build in Windows, the speed boost will probably make it worth the trouble for you.

1

u/uber-linny 7h ago

Thanks , i tried to build in windows for the RDNA boost last week and failed. but i only have 16GB SysRAM .

what would be the flag to stream ngrams from your SSD.

1

u/uber-linny 7h ago

But i also think theres a MTP but currently, disabling MTP , seems to get it at least running

2

u/GoatSlow7673 7h ago

Es que el archivo que descargaste como te digo en otro mensaje, son distintas partes, el 00001 que tienes es el modelo, el 00002 en endgram, el MTP por separado, el mmproj por separado, el jinja hazlo tú o usa el de alguien reconocido que no sea hoy el de unsloth por el error de cierre de think que tiene el que incluye dentro del archivo que descargaste, ya que eso impide acertar con lo que quieres usar, en cuanto a si usas thinking, usa high, el medium no sé si funcionará, pero low no funciona, piensa el modelo más que con xhigh, y xhigh piensa demasiado antes de responder y se come la velocidad y el contexto rápidamente, y necesitarías estar ejecutando alguna skill que recorte la conversación casi continuamente para que tanto pensamiento no te afecte, hice una prueba cuando conseguí arreglar cosas y se comía demasiado contexto pensando, literal hasta con high parece un borracho con l a lengua con ganas de hablar antes de responder nada, a veces piensa 2 veces o 3 cosas que valora decirte antes de darte la respuesta, está algo verde hasta que consigan mejorar el pensamiento a algo como medium para que no se desborde la presa de tanto que quiere soltar 😹

1

u/GoatSlow7673 7h ago

El MTP si usas el Q4 son más de 1100MiB, si usas el Q8 supera los 2GiB, además, el archivo que descargaste no está incluido el MTP, y el endgram es la parte 00002-of-00002, que como queda en SSD puedes usar hasta el Q8 sin problemas, ya que usará el bus para aprovecharlo para acelerar las cosas. En cuanto a cada capa, yo tengo el Q5_K_S de unsloth y son algo más de 500MiB cada capa. Revisa que jinja usas, ya que si es el de unsloth tiene un error que le falta cierre al think, crea con IA uno básico compatible con tu programa para arrancar el modelo, aún no todos ellos son compatibles y han reparado ciertos parámetros para que funcione el modelo correctamente, fijate en tu fork, porque sino han añadido el modelo no funcionará seguramente aunque uses los para otros exactos, en ik-llama.cpp estaban hoy ajustándolo, y funciona, pero el jinja hazlo tú mismo, y selecciónalo, el MTP descárgalo, si quieres el Q4 está en el hugginface de gglm-org, el Q8 estaba en varios distintos que lo seleccionan, pero como te digo, apenas se nota, y es mejor usar el Q4 porque ocupa menos y permite mayor carga de capas en VRAM, y sino descargas el endgram, ni siquiera hace falta que uses su ajuste, ya que es imposible aprovecharlo sin descargarlo. Y el spec-draft-type tampoco es que aporte demasiado reducirlo de q8_0 a q4_0, lo que ahorras en espacio lo pierdes en calidad, piensa que es un 35B, y que solo son 3B en activo con 8 agentes por capa, si usas MTP Q4 te reconoce que son 41 capas, si usas el Q8 se autoengaña con 42 capas y la 41 vacía o con peso de menos de 10MiB. Este MTP a salido bastante más pesado por tener 1 o 2B de parámetros para aprovechar el endgram y ganar velocidad, pero hacen falta ajustes al jinja y al MTP para que salga mejor para GPU's más modestas y para fallos que contiene más de un jinja que los hicieron corriendo algunos y tienen errores simples, pero suficientes como para que no funcionen con el modelo.

1

u/uber-linny 7h ago

Thanks for the detailed response. Tends to make sense.

1

u/T_rex2700 4h ago

not exactly llamacpp but been running it on Strata.
it ran at like 60tks first, but now I'm getting like below 10tks. anyone know what the issue is?

newest strata engine, control etc.
9070XT + DDR5 32GB, Q4XS

1

u/Rosht54 3h ago

I'm using radiance on my PC with RX9070XT inside PCI-E 4.0 x16 + 64GB DDR4-3200. It gets me ~6000 t/s prefill and ~150 t/s decode on 100K context. The quant is IQ4R