PEScn commited on
Commit
d8f7d9a
·
verified ·
1 Parent(s): 1b99ce9

Fix Qwen 9B launcher and document verified bf16 serving

Browse files
Files changed (3) hide show
  1. INFERENCE.md +7 -1
  2. SHA256SUMS +7 -7
  3. serve_knowline.sh +6 -9
INFERENCE.md CHANGED
@@ -22,7 +22,7 @@ The included front end consists of:
22
  - `knowline_layout.py`: prompt layout and read-twice logic;
23
  - `serve_knowline.sh`: SGLang launch helper.
24
 
25
- Use a compatible SGLang and Transformers installation. The original evaluation used bf16 SGLang with the model's Qwen3.5 chat template, thinking disabled, 16 scoring workers, and read-twice enabled for short text-only requests.
26
 
27
  ## Read twice
28
 
@@ -46,6 +46,8 @@ Equivalent shape:
46
  CUDA_VISIBLE_DEVICES=0 python -m sglang.launch_server \
47
  --model-path /path/to/KnowLine-9B-Gen1 \
48
  --served-model-name m \
 
 
49
  --port 9080
50
 
51
  python knowline_server.py \
@@ -78,3 +80,7 @@ The predicted board Full uses the internal 9B comparison rule `full_noproc + 1.0
78
  - The front end is for structured decisions, not open-ended chat.
79
 
80
  `SHA256SUMS` covers every file in the repository.
 
 
 
 
 
22
  - `knowline_layout.py`: prompt layout and read-twice logic;
23
  - `serve_knowline.sh`: SGLang launch helper.
24
 
25
+ The earlier internal candidate evaluation used FP8-at-load SGLang. The release launcher uses bf16 SGLang 0.5.21 with Qwen3.5's chat template, thinking disabled, 16 scoring workers, and read-twice enabled for short text-only requests. A fresh full public DI run with the release package was started on 2026-10-25; the sample and predicted scores below are not its result.
26
 
27
  ## Read twice
28
 
 
46
  CUDA_VISIBLE_DEVICES=0 python -m sglang.launch_server \
47
  --model-path /path/to/KnowLine-9B-Gen1 \
48
  --served-model-name m \
49
+ --tp 1 --mem-fraction-static 0.85 --enable-fp32-lm-head \
50
+ --mamba-radix-cache-strategy extra_buffer \
51
  --port 9080
52
 
53
  python knowline_server.py \
 
80
  - The front end is for structured decisions, not open-ended chat.
81
 
82
  `SHA256SUMS` covers every file in the repository.
83
+
84
+ ## Serving correction (2026-10-25)
85
+
86
+ The launcher now uses Qwen's `locate`/`xyxy` box settings and no longer references the absent Gemma-specific `temperatures.json`. The folded T=1.18 remains the only readout scaling. Choice, yes/no and score requests passed an actual two-server bf16 smoke run before the full DI run was started. Image and box output quality is not established by that text-only smoke.
SHA256SUMS CHANGED
@@ -1,13 +1,15 @@
1
  93691240311786c93e1c21b53dfb9d52743cf02958709c1048fab77760aacb73 CALIBRATION.json
 
 
 
 
 
2
  a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 chat_template.jinja
3
  d0883072e01861ed0b2d47be3c16c36a8e81c224c7ffaa310c6558fb3f932b05 config.json
4
  2d4464e2ead06bc9bc718c781309ad1e7baded626d66e8dcdc8b469ba185faf0 configuration.json
5
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 FIXED
6
- b1d687b090e7482245f5e8f318ba66a6f2dbf3e488989fc47fa4967884b82c1b INFERENCE.md
7
  4f05e06b6021e6b0b5f00d4c6bc2f98a3a824c9a254ec901ba42c9070ac50ac9 knowline_engine.py
8
  2e839fa24f1ad9c980898b2a9aa62e2154ba3f57618bd5f2fedb5756f61f062f knowline_layout.py
9
  13ca50c4001fac0aa3899a35ff01e60f311132c571b17a8c3dc7aa6001ad2f3f knowline_server.py
10
- 50cbab8a892c5f2993b8c7351a99182507472def3b1374558308605d99b86b32 LICENSE
11
  a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt
12
  fe50afcf194c87e6faaf5c89ef74caf4f9e635f70ca8a5e8b14231383415d13d model-00001-of-00004.safetensors
13
  4981e1d31be80bb4bacfaa57b0ad9c3370ce170eee5f71451229017b5a52a2f7 model-00002-of-00004.safetensors
@@ -16,10 +18,8 @@ f901558f89699dc6d96343ba9cdb29c916d0db1377c4ecfa546f2d280cc5373a model-00003-of
16
  c41ed69b9d21f0772737d4fb74bf48283a473ec34fb5df07afb487f35d67c28f model-extra-from-base.safetensors
17
  efee6aea7d27319549e35f3bf76600eeb1313fa6bedf353d810e053bbdff8a81 model.safetensors.index.json
18
  27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json
19
- 99241ebf63cb005cf260f3309e6a789e64b870e9b130b3a246a69d99f0dc003c README.md
20
- 63dd693b2b91bfab2f29d04a3b5cac94375edf5f1d4f5df228fdd85529699801 README.zh.md
21
- 166cbef96c8cffe5a812138c119ec12d6589c7f619289682e45cce0063a9169d serve_knowline.sh
22
- 316230d6a809701f4db5ea8f8fc862bc3a6f3229c937c174e674ff3ca0a64ac8 tokenizer_config.json
23
  5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42 tokenizer.json
 
24
  7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.json
25
  ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json
 
1
  93691240311786c93e1c21b53dfb9d52743cf02958709c1048fab77760aacb73 CALIBRATION.json
2
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 FIXED
3
+ 52afcf93c23e48c850c38d2e1ac8f0a1510dfa5c526effe70aefba00b45a6b75 INFERENCE.md
4
+ 50cbab8a892c5f2993b8c7351a99182507472def3b1374558308605d99b86b32 LICENSE
5
+ 99241ebf63cb005cf260f3309e6a789e64b870e9b130b3a246a69d99f0dc003c README.md
6
+ 63dd693b2b91bfab2f29d04a3b5cac94375edf5f1d4f5df228fdd85529699801 README.zh.md
7
  a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 chat_template.jinja
8
  d0883072e01861ed0b2d47be3c16c36a8e81c224c7ffaa310c6558fb3f932b05 config.json
9
  2d4464e2ead06bc9bc718c781309ad1e7baded626d66e8dcdc8b469ba185faf0 configuration.json
 
 
10
  4f05e06b6021e6b0b5f00d4c6bc2f98a3a824c9a254ec901ba42c9070ac50ac9 knowline_engine.py
11
  2e839fa24f1ad9c980898b2a9aa62e2154ba3f57618bd5f2fedb5756f61f062f knowline_layout.py
12
  13ca50c4001fac0aa3899a35ff01e60f311132c571b17a8c3dc7aa6001ad2f3f knowline_server.py
 
13
  a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt
14
  fe50afcf194c87e6faaf5c89ef74caf4f9e635f70ca8a5e8b14231383415d13d model-00001-of-00004.safetensors
15
  4981e1d31be80bb4bacfaa57b0ad9c3370ce170eee5f71451229017b5a52a2f7 model-00002-of-00004.safetensors
 
18
  c41ed69b9d21f0772737d4fb74bf48283a473ec34fb5df07afb487f35d67c28f model-extra-from-base.safetensors
19
  efee6aea7d27319549e35f3bf76600eeb1313fa6bedf353d810e053bbdff8a81 model.safetensors.index.json
20
  27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json
21
+ 401aa4b029b48967633807a577767448ac937c3c35d43b598d6c042982ba70b4 serve_knowline.sh
 
 
 
22
  5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42 tokenizer.json
23
+ 316230d6a809701f4db5ea8f8fc862bc3a6f3229c937c174e674ff3ca0a64ac8 tokenizer_config.json
24
  7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.json
25
  ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json
serve_knowline.sh CHANGED
@@ -1,11 +1,9 @@
1
  #!/bin/bash
2
- # Serve KnowLine-31B-Gen1 behind /v1/systemone with the settings of our Decision Index run (see INFERENCE.md).
3
  # bash serve_knowline.sh <model dir or HF repo id> [gpu=0] [port=8080]
4
- # Starts the SGLang engine (bf16; port = front-end port + 1000), then knowline_server.py (chat style,
5
- # temperature 1, 16 scoring threads, read twice: on by default in knowline_server.py, per-type temperatures from
6
- # temperatures.json: score questions / 0.6944, so their effective temperature is 1.0; box questions in Gemma's
7
- # box_2d format read y first, with box_calibration.json when present), which needs only transformers
8
- # and requests; knowline_layout.py must sit next to it.
9
  # MEM (default 0.85) is SGLang's --mem-fraction-static: it only sizes the KV cache, scores do not depend on it.
10
  # HOST (default 127.0.0.1) is the front end's bind address.
11
  # Without SGLang: python knowline_server.py --model <model> --backend hf --port 8080 (transformers, slower).
@@ -14,7 +12,7 @@ MODEL=${1:?usage: serve_knowline.sh <model dir or HF repo id> [gpu] [port]}
14
  GPU=${2:-0}; PORT=${3:-8080}; SGL_PORT=$((PORT + 1000)); MEM=${MEM:-0.85}; HOST=${HOST:-127.0.0.1}
15
  HERE=$(cd "$(dirname "$0")" && pwd)
16
  CUDA_VISIBLE_DEVICES=$GPU python -m sglang.launch_server --model-path "$MODEL" --served-model-name m --tp 1 \
17
- --mem-fraction-static "$MEM" --enable-fp32-lm-head \
18
  --port "$SGL_PORT" &
19
  SGL=$!
20
  trap 'kill "$SGL" 2>/dev/null || true' EXIT
@@ -23,5 +21,4 @@ until curl -sf -m 3 "http://127.0.0.1:$SGL_PORT/health" > /dev/null; do
23
  done
24
  python "$HERE/knowline_server.py" --model "$MODEL" --backend sglang --url "http://127.0.0.1:$SGL_PORT" \
25
  --served-model-name m --temperature 1 --workers 16 --host "$HOST" --port "$PORT" \
26
- --temperatures "$HERE/temperatures.json" --box-prompt gemma --box-coords yxyx \
27
- $([ -f "$HERE/box_calibration.json" ] && echo --box-calibration "$HERE/box_calibration.json")
 
1
  #!/bin/bash
2
+ # Serve KnowLine-9B-Gen1 behind /v1/systemone (see INFERENCE.md).
3
  # bash serve_knowline.sh <model dir or HF repo id> [gpu=0] [port=8080]
4
+ # Starts SGLang in bf16 (port = front-end port + 1000), then knowline_server.py.
5
+ # Read twice is enabled by default; temperature 1 preserves the folded T=1.18.
6
+ # No Gemma-specific temperatures file is used. Untrained boxes use Qwen's xyxy format.
 
 
7
  # MEM (default 0.85) is SGLang's --mem-fraction-static: it only sizes the KV cache, scores do not depend on it.
8
  # HOST (default 127.0.0.1) is the front end's bind address.
9
  # Without SGLang: python knowline_server.py --model <model> --backend hf --port 8080 (transformers, slower).
 
12
  GPU=${2:-0}; PORT=${3:-8080}; SGL_PORT=$((PORT + 1000)); MEM=${MEM:-0.85}; HOST=${HOST:-127.0.0.1}
13
  HERE=$(cd "$(dirname "$0")" && pwd)
14
  CUDA_VISIBLE_DEVICES=$GPU python -m sglang.launch_server --model-path "$MODEL" --served-model-name m --tp 1 \
15
+ --mem-fraction-static "$MEM" --enable-fp32-lm-head --mamba-radix-cache-strategy extra_buffer \
16
  --port "$SGL_PORT" &
17
  SGL=$!
18
  trap 'kill "$SGL" 2>/dev/null || true' EXIT
 
21
  done
22
  python "$HERE/knowline_server.py" --model "$MODEL" --backend sglang --url "http://127.0.0.1:$SGL_PORT" \
23
  --served-model-name m --temperature 1 --workers 16 --host "$HOST" --port "$PORT" \
24
+ --box-prompt locate --box-coords xyxy