Files
gemma-3-1b-it-Math-SFT/README.md
ModelHub XC b9dd455e0f 初始化项目,由ModelHub XC社区提供模型
Model: NotoriousH2/gemma-3-1b-it-Math-SFT
Source: Original Platform
2026-07-04 17:54:15 +08:00

141 lines
16 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
language: ko
license: apache-2.0
base_model: google/gemma-3-1b-it
tags:
- math
- korean
- sft
- gemma
- distillation
datasets:
- NotoriousH2/HRM8K
---
# Gemma-3-1B-IT Math SFT
`google/gemma-3-1b-it`를 한국어 수학 문제(GSM8K)에 대해 교사 증류 SFT한 모델.
## 성능
| Benchmark | Score |
|-----------|-------|
| HRM8K eval GSM8K (264문제, Korean) | **~44.9%** (3회 평균) |
| HRM8K eval MATH (577문제, Korean) | ~17% |
평가: temperature=0, vLLM 서빙, max_tokens=2048
## 데이터 생성 파이프라인
### 원본 데이터
- **GSM8K train set**: 영어 초등 수학 7,473문제 ([openai/gsm8k](https://huggingface.co/datasets/openai/gsm8k))
- **평가 데이터**: [HRM8K](https://huggingface.co/datasets/NotoriousH2/HRM8K) eval set 841문제 (GSM8K 264 + MATH 577, 한국어)
### 교사 모델
- **모델**: (AWQ 4bit)
- **서빙**: vLLM 0.11.0 (구버전 필요, AWQ 호환),
- **중요**: 이 교사 모델은 HRM8K 학습 데이터를 생성한 바로 그 모델. 다른 교사 모델(Qwen3.5-9B/35B 등)은 스타일 불일치로 -10%p 이상 성능 하락.
### 2단계 데이터 생성
### 최종 학습 데이터 형식
- 총 26,254개 (train 95% / eval 5% split)
- 시스템 프롬프트:
## 학습 설정
## 재현 방법
INFO 03-19 14:51:58 [__init__.py:216] Automatically detected platform cuda.
(APIServer pid=3426235) INFO 03-19 14:52:04 [api_server.py:1839] vLLM API server version 0.11.0
(APIServer pid=3426235) INFO 03-19 14:52:04 [utils.py:233] non-default args: {'model_tag': 'cpatonn/Qwen3-30B-A3B-Instruct-2507-AWQ-4bit', 'port': 8001, 'model': 'cpatonn/Qwen3-30B-A3B-Instruct-2507-AWQ-4bit', 'max_model_len': 4096, 'gpu_memory_utilization': 0.8}
(APIServer pid=3426235) INFO 03-19 14:52:06 [model.py:547] Resolved architecture: Qwen3MoeForCausalLM
(APIServer pid=3426235) INFO 03-19 14:52:06 [model.py:1510] Using max model len 4096
(APIServer pid=3426235) INFO 03-19 14:52:07 [scheduler.py:205] Chunked prefill is enabled with max_num_batched_tokens=8192.
INFO 03-19 14:52:19 [__init__.py:216] Automatically detected platform cuda.
(EngineCore_DP0 pid=3426796) INFO 03-19 14:52:25 [core.py:644] Waiting for init message from front-end.
(EngineCore_DP0 pid=3426796) INFO 03-19 14:52:25 [core.py:77] Initializing a V1 LLM engine (v0.11.0) with config: model='cpatonn/Qwen3-30B-A3B-Instruct-2507-AWQ-4bit', speculative_config=None, tokenizer='cpatonn/Qwen3-30B-A3B-Instruct-2507-AWQ-4bit', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=4096, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, disable_custom_all_reduce=False, quantization=compressed-tensors, enforce_eager=False, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser=''), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None), seed=0, served_model_name=cpatonn/Qwen3-30B-A3B-Instruct-2507-AWQ-4bit, enable_prefix_caching=True, chunked_prefill_enabled=True, pooler_config=None, compilation_config={"level":3,"debug_dump_path":"","cache_dir":"","backend":"","custom_ops":[],"splitting_ops":["vllm.unified_attention","vllm.unified_attention_with_output","vllm.mamba_mixer2","vllm.mamba_mixer","vllm.short_conv","vllm.linear_attention","vllm.plamo2_mamba_mixer","vllm.gdn_attention","vllm.sparse_attn_indexer"],"use_inductor":true,"compile_sizes":[],"inductor_compile_config":{"enable_auto_functionalized_v2":false},"inductor_passes":{},"cudagraph_mode":[2,1],"use_cudagraph":true,"cudagraph_num_of_warmups":1,"cudagraph_capture_sizes":[512,504,496,488,480,472,464,456,448,440,432,424,416,408,400,392,384,376,368,360,352,344,336,328,320,312,304,296,288,280,272,264,256,248,240,232,224,216,208,200,192,184,176,168,160,152,144,136,128,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,4,2,1],"cudagraph_copy_inputs":false,"full_cuda_graph":false,"use_inductor_graph_partition":false,"pass_config":{},"max_capture_size":512,"local_cache_dir":null}
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
(EngineCore_DP0 pid=3426796) INFO 03-19 14:52:26 [parallel_state.py:1208] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, TP rank 0, EP rank 0
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] EngineCore failed to start.
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] Traceback (most recent call last):
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 699, in run_engine_core
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] engine_core = EngineCoreProc(*args, **kwargs)
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 498, in __init__
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] super().__init__(vllm_config, executor_class, log_stats,
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 83, in __init__
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] self.model_executor = executor_class(vllm_config)
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/executor/executor_base.py", line 54, in __init__
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] self._init_executor()
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/executor/uniproc_executor.py", line 54, in _init_executor
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] self.collective_rpc("init_device")
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/executor/uniproc_executor.py", line 83, in collective_rpc
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] return [run_method(self.driver_worker, method, args, kwargs)]
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/utils/__init__.py", line 3122, in run_method
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] return func(*args, **kwargs)
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/worker/worker_base.py", line 259, in init_device
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] self.worker.init_device() # type: ignore
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 187, in init_device
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] raise ValueError(
(EngineCore_DP0 pid=3426796) ERROR 03-19 14:52:26 [core.py:708] ValueError: Free memory on device (7.29/93.1 GiB) on startup is less than desired GPU memory utilization (0.8, 74.48 GiB). Decrease GPU memory utilization or reduce GPU memory used by other processes.
INFO 03-19 14:52:34 [__init__.py:216] Automatically detected platform cuda.
(APIServer pid=3427292) INFO 03-19 14:52:40 [api_server.py:1839] vLLM API server version 0.11.0
(APIServer pid=3427292) INFO 03-19 14:52:40 [utils.py:233] non-default args: {'model_tag': './outputs/models/c17d-gemma-3-1b-it-Math', 'model': './outputs/models/c17d-gemma-3-1b-it-Math', 'dtype': 'bfloat16', 'max_model_len': 4096, 'gpu_memory_utilization': 0.85}
(APIServer pid=3427292) INFO 03-19 14:52:51 [model.py:547] Resolved architecture: Gemma3ForCausalLM
(APIServer pid=3427292) INFO 03-19 14:52:51 [model.py:1510] Using max model len 4096
(APIServer pid=3427292) INFO 03-19 14:52:51 [scheduler.py:205] Chunked prefill is enabled with max_num_batched_tokens=8192.
INFO 03-19 14:52:58 [__init__.py:216] Automatically detected platform cuda.
(EngineCore_DP0 pid=3428117) INFO 03-19 14:53:03 [core.py:644] Waiting for init message from front-end.
(EngineCore_DP0 pid=3428117) INFO 03-19 14:53:03 [core.py:77] Initializing a V1 LLM engine (v0.11.0) with config: model='./outputs/models/c17d-gemma-3-1b-it-Math', speculative_config=None, tokenizer='./outputs/models/c17d-gemma-3-1b-it-Math', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=4096, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser=''), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None), seed=0, served_model_name=./outputs/models/c17d-gemma-3-1b-it-Math, enable_prefix_caching=True, chunked_prefill_enabled=True, pooler_config=None, compilation_config={"level":3,"debug_dump_path":"","cache_dir":"","backend":"","custom_ops":[],"splitting_ops":["vllm.unified_attention","vllm.unified_attention_with_output","vllm.mamba_mixer2","vllm.mamba_mixer","vllm.short_conv","vllm.linear_attention","vllm.plamo2_mamba_mixer","vllm.gdn_attention","vllm.sparse_attn_indexer"],"use_inductor":true,"compile_sizes":[],"inductor_compile_config":{"enable_auto_functionalized_v2":false},"inductor_passes":{},"cudagraph_mode":[2,1],"use_cudagraph":true,"cudagraph_num_of_warmups":1,"cudagraph_capture_sizes":[512,504,496,488,480,472,464,456,448,440,432,424,416,408,400,392,384,376,368,360,352,344,336,328,320,312,304,296,288,280,272,264,256,248,240,232,224,216,208,200,192,184,176,168,160,152,144,136,128,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,4,2,1],"cudagraph_copy_inputs":false,"full_cuda_graph":false,"use_inductor_graph_partition":false,"pass_config":{},"max_capture_size":512,"local_cache_dir":null}
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
[Gloo] Rank 0 is connected to 0 peer ranks. Expected number of connected peer ranks is : 0
(EngineCore_DP0 pid=3428117) INFO 03-19 14:53:05 [parallel_state.py:1208] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, TP rank 0, EP rank 0
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] EngineCore failed to start.
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] Traceback (most recent call last):
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 699, in run_engine_core
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] engine_core = EngineCoreProc(*args, **kwargs)
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 498, in __init__
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] super().__init__(vllm_config, executor_class, log_stats,
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 83, in __init__
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] self.model_executor = executor_class(vllm_config)
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/executor/executor_base.py", line 54, in __init__
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] self._init_executor()
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/executor/uniproc_executor.py", line 54, in _init_executor
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] self.collective_rpc("init_device")
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/executor/uniproc_executor.py", line 83, in collective_rpc
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] return [run_method(self.driver_worker, method, args, kwargs)]
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/utils/__init__.py", line 3122, in run_method
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] return func(*args, **kwargs)
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/worker/worker_base.py", line 259, in init_device
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] self.worker.init_device() # type: ignore
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] ^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] File "/tmp/.venv/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 187, in init_device
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] raise ValueError(
(EngineCore_DP0 pid=3428117) ERROR 03-19 14:53:05 [core.py:708] ValueError: Free memory on device (7.29/93.1 GiB) on startup is less than desired GPU memory utilization (0.85, 79.13 GiB). Decrease GPU memory utilization or reduce GPU memory used by other processes.
## 파일
- : SFT 학습 스크립트
- : HRM8K 평가 스크립트 (vLLM OpenAI API 호환 서버 필요)