Downloads · 30 days
0
FolksyPizza/Qwen3-14B-PMC
Qwen3-14B-PMC is a machine learning model from FolksyPizza. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
(pmc) is a CUDA-first, TPU-capable training and evaluation stack for building instruction-tuned and RL-refined Qwen3 derivatives that remain deployable on a consumer GPU.
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py581 KB · 91%
From the Hugging Face model README
(pmc) is a CUDA-first, TPU-capable training and evaluation stack for building instruction-tuned and RL-refined Qwen3 derivatives that remain deployable on a consumer GPU.
Selected models:
Qwen/Qwen3-14BQwen/Qwen3-1.7BWhy Qwen3-14B:
Qwen3-14B, which keeps downstream fine-tuning and distribution practical.Qwen3-14B Hugging Face card exposes native chat-template support, a reasoning toggle, and tool-use guidance, which reduces integration friction for SFT, RL, and agentic evaluation.14.8B parameters is large enough to be a meaningful mainline model while still being realistic to load in 4-bit NF4 on a 12 GB RTX 3060 during development.Why Qwen3-1.7B:
1.7B scale is the safest choice for comfortable bf16 experimentation and local interpretability work on a 12 GB RTX 3060.transformers support make it easy to use for rapid iteration, synthetic data generation, and regression testing.Relevant primary sources:
https://qwenlm.github.io/blog/qwen3/Qwen/Qwen3-14B: https://huggingface.co/Qwen/Qwen3-14BQwen/Qwen3-1.7B: https://huggingface.co/Qwen/Qwen3-1.7Bpmc/
├── README.md
├── requirements.txt
├── requirements_tpu.txt
├── setup.py
├── configs/
├── data/
├── training/
├── interpretability/
├── eval/
├── inference/
└── results/
cd pmc
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt
If you want Flash Attention 2 and your local CUDA toolchain supports it:
pip install flash-attn==2.7.4.post1 --no-build-isolation
cd pmc
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r requirements_tpu.txt
python data/download_datasets.py --cache_dir ./data/cache/huggingface --output_root ./data/raw
python data/preprocess.py \
--raw_root ./data/raw \
--output_root ./data/artifacts/processed \
--manifest_path ./data/artifacts/preprocess_manifest.json \
--model_name Qwen/Qwen3-14B
python data/build_sft_dataset.py --processed_root ./data/artifacts/processed --output_root ./data/artifacts/sft_tokenized_normal
python data/build_rl_dataset.py --raw_root ./data/raw --output_root ./data/artifacts/rl_dataset
python data/dataset_stats.py --processed_root ./data/artifacts/processed --tokenized_root ./data/artifacts/sft_tokenized_normal --rl_root ./data/artifacts/rl_dataset
python training/train.py \
--device cuda \
--variant normal \
--phase sft \
--config configs/base_normal.yaml \
--lora_config configs/lora_normal.yaml
python training/train.py \
--device cuda \
--variant normal \
--phase grpo \
--config configs/base_normal.yaml \
--resume ./checkpoints/latest
python training/train.py \
--device cuda \
--variant normal \
--phase rejection \
--config configs/base_normal.yaml \
--resume ./checkpoints/latest
python training/train.py \
--device cuda \
--variant small \
--phase sft \
--config configs/base_small.yaml \
--lora_config configs/lora_small.yaml
Append --wandb to any training/train.py invocation.
Every evaluation script supports either a GGUF model through llama-cpp-python or a Hugging Face model directory with --model_path.
bash eval/eval_all.sh ./models/pmc-q4_k_m.gguf
Or run individually:
python eval/run_math.py --model_path ./models/pmc-q4_k_m.gguf
python eval/run_gpqa.py --model_path ./exports/pmc-merged
python eval/run_agentic.py --model_path ./exports/pmc-merged
python eval/run_swebench.py --model_path ./exports/pmc-merged
Results are written under results/.
Linear probes:
python interpretability/linear_probing.py \
--model_name Qwen/Qwen3-1.7B \
--dataset_path ./artifacts/probes/careful_reasoning.jsonl \
--output_dir ./interpretability/results/probes
Steering vectors:
python interpretability/steering_vectors.py \
--model_name Qwen/Qwen3-1.7B \
--dataset_path ./artifacts/probes/careful_reasoning.jsonl \
--probe_metrics ./interpretability/results/probes/metrics.json \
--concept careful_reasoning \
--alpha 15 \
--prompt "Solve this step by step: 147 * 28"
Activation patching:
python interpretability/activation_patching.py \
--model_name Qwen/Qwen3-1.7B \
--clean_prompt "The answer is 42 because..." \
--corrupted_prompt "The answer is 24 because..." \
--output_png ./interpretability/results/activation_patching.png
Merge adapters and export quantized variants:
python inference/quantize.py \
--base_model_name Qwen/Qwen3-14B \
--adapter_path ./checkpoints/merged-lora \
--variant normal \
--llama_cpp_dir ~/src/llama.cpp \
--output_dir ./exports/pmc
Serve a GGUF model with an OpenAI-compatible route:
python inference/serve.py \
--model_path ./exports/pmc/model-Q4_K_M.gguf \
--host 0.0.0.0 \
--port 8000
Benchmark inference:
python inference/benchmark_inference.py \
--hf_model_path ./exports/pmc/hf_merged \
--gguf_q4_path ./exports/pmc/model-Q4_K_M.gguf \
--gguf_q8_path ./exports/pmc/model-Q8_0.gguf
3060 guidance:
--n_gpu_layers -1 is appropriate when the full GGUF fits.4080 / 4090 guidance:
PMC keeps the same training/train.py entrypoint and switches hardware behavior with --device tpu.
gcloud alpha compute tpus tpu-vm create pmc-v5e-8 \
--zone=us-central1-a \
--accelerator-type=v5e-8 \
--version=tpu-vm-tf-2.18.0-pjrt
gcloud alpha compute tpus tpu-vm ssh pmc-v5e-8 --zone=us-central1-a
git clone <your-repo-url> pmc
cd pmc
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r requirements_tpu.txt
gcloud auth application-default login
gsutil mb -l us-central1 gs://your-pmc-bucket
mkdir -p /mnt/gcs
gcsfuse your-pmc-bucket /mnt/gcs
python training/train.py \
--device tpu \
--variant normal \
--phase sft \
--config configs/base_normal_tpu.yaml \
--lora_config configs/lora_normal.yaml
tensorboard --logdir gs://your-pmc-bucket/logs --bind_all
gsutil -m cp -r gs://your-pmc-bucket/checkpoints/final ./downloaded-checkpoint
torch_xla helpers for multi-device execution; CUDA remains the reference path for debugging.safetensors format and optionally mirrored to gs:// when configured.