#!/bin/bash # Gemma 4 31B runs that need special serving on Hopper (SM90): # FlashInfer has no mm_prefix (bidirectional image attention) support on SM90, and NVFP4 KV exists only # in FlashInfer, so BF16-FI and FP4 are served text-only (--language-model-only): RULER + MRCR, no DocVQA. # FP8 KV with images needs the TRITON_FLASH_ATTN composite (image prefills -> Triton, text -> FA3/FA4); # BF16-TFA reruns DocVQA on the same composite as FP8's matched DocVQA baseline. # Usage: gemma_rest.sh fa (GPU 0, after after_tb.sh finishes there) # gemma_rest.sh fi (GPU 1) cd ~/bench export KVQ_MODEL=~/models/gemma-4-31B-it KVQ_NAME=google/gemma-4-31B-it KVQ_REASONING_PARSER=gemma4 \ KVQ_MAX_LEN=262144 KVQ_EXTRA_BODY='{"chat_template_kwargs":{"enable_thinking":true}}' \ KVQ_DATA=data_gemma KVQ_EXP_OUT=exp2_gemma KVQ_MRCR_OUT=mrcr_gemma case $1 in fa) export GPU=0 PORT=8000 until grep -q "AFTER_TB_DONE GPU0" ~/bench/after_tb_gpu0.log; do sleep 120; done KVQ_BACKEND=TRITON_FLASH_ATTN MRCR=1 ./exp2.sh FP8 FP8 KVQ_BACKEND=TRITON_FLASH_ATTN LENS="" ./exp2.sh BF16-TFA BF16 ;; fi) export GPU=1 PORT=8001 KVQ_SERVE_ARGS=--language-model-only KVQ_DOCVQA=0 MRCR=1 ./exp2.sh BF16-FI BF16-FI ./exp2.sh FP4 FP4 ;; esac echo "GEMMA_REST_DONE $1 $(date -u)"