Skip to content

feat: add Hermes-4.3-36B (dense) support and optimize architecture profiles#1

Merged
aWN4Y25pa2EK merged 11 commits into
mainfrom
feat/hermes-36b
Mar 1, 2026
Merged

feat: add Hermes-4.3-36B (dense) support and optimize architecture profiles#1
aWN4Y25pa2EK merged 11 commits into
mainfrom
feat/hermes-36b

Conversation

@aWN4Y25pa2EK
Copy link
Copy Markdown
Member

Summary

  • Added new model hermes-4.3-36b (NousResearch/Hermes-4.3-36B Q4_K_M)
  • Empirically tested dense 36B architecture limits on RTX 5090 (32GB VRAM):
    • Pure decode: ~64.5 tok/s
    • 4-concurrent aggregate: ~132.0 tok/s
  • Tuned Hermes rtx5090 profile for dense compute constraints:
    • Dropped context to 32768 to fit 4 slots within 32GB VRAM
    • Kept --parallel 4 (yields 2x aggregate throughput vs 1 slot)
    • Kept KV cache q8_0 (empirically faster than q4_0 under heavy dense compute)
    • Re-enabled prompt cache (no DeltaNet limitations here)
  • Refactored docker-compose.yml and Makefile to use FOUNDRY_MODEL env var instead of hardcoding services, making the repository fully modular
  • Updated Prometheus config to scrape dynamic inference container name
  • Added Hermes architecture details and empirical benchmarks to README.md

Foundry Bot added 11 commits March 1, 2026 15:01
…ofiles

- Add new model `hermes-4.3-36b` (NousResearch/Hermes-4.3-36B Q4_K_M)
- Empirically test dense 36B architecture limits on RTX 5090 (32GB VRAM):
  - Pure decode: ~64.5 tok/s
  - 4-concurrent aggregate: ~132.0 tok/s
- Tune Hermes rtx5090 profile for dense compute constraints:
  - Drop context to 32768 to fit 4 slots within 32GB VRAM
  - Keep --parallel 4 (yields 2x aggregate throughput vs 1 slot)
  - Keep KV cache q8_0 (empirically faster than q4_0 under heavy dense compute)
  - Re-enable prompt cache (no DeltaNet limitations here)
- Refactor `docker-compose.yml` and `Makefile` to use `FOUNDRY_MODEL` env var
  instead of hardcoding services, making the repository fully modular
- Update Prometheus config to scrape dynamic `inference` container name
- Add Hermes architecture details and empirical benchmarks to README
…nd tooling

- Introduce FOUNDRY_ARCH env (moe/dense) in Dockerfiles for systematic
  architecture-aware flag gating (--fit only for MoE, via Tier 1 in entrypoint)
- Extract shared entrypoint to scripts/entrypoint.sh with 3-tier flag system:
  Tier 1 (architecture), Tier 2 (hardware profile), Tier 3 (user overrides)
- Move model-specific flags (--swa-full, --cache-ram 0) out of arch tier
  into qwen PROFILE_EXTRA_ARGS where they belong (not all MoE needs these)
- Remove PROFILE_FIT from qwen profiles (now driven by FOUNDRY_ARCH=moe)
- Fix Hermes 4-concurrent benchmark: ~170 tok/s (was incorrectly ~132)
- Remove duplicate Hermes benchmark table in README
- Add hf_transfer to qwen Dockerfile for download parity
- Update CI to matrix strategy building both models
- Update download-model.sh to support --model flag
- Fix Grafana dashboard container filter (inference, not qwen)
- Restore prometheus depends_on for inference service
- Update README: architecture tree, model selection docs, build commands

Validated on RTX 5090: both models build, launch with correct flags
(no duplicates), serve inference, and integrate with full monitoring
stack (Prometheus scraping all 5 targets, Grafana healthy).
- Add .github/workflows/lint.yml with ruff (Python) and shellcheck (bash)
- Add pyproject.toml with ruff config (E/F/W/I/UP/B/SIM rules, 100 char line)
- Fix existing lint issues: unused import, empty f-strings, import order, line length
- Format all Python files with ruff
- Refactor model Dockerfiles to multi-stage from-scratch builds compiling
  llama.cpp natively for sm_89 and sm_120a (Blackwell) to avoid upstream
  JIT/fallback overhead and drastically reduce final image size.
- Switch Hermes source to official NousResearch/Hermes-4.3-36B-GGUF repo.
- Update host-setup.sh with high-impact Linux kernel tweaks (numa_balancing=0,
  vm.swappiness=0, THP defrag, NVMe schedulers) discovered via profiling.
- Add memlock unlimited ulimits to docker-compose.yml for mlock safety.
- Integrates Cloudflare's ebpf_exporter to trace deep Linux kernel metrics
  (starting with biolatency to trace exact NVMe model loading performance).
- Adds ebpf_exporter to the docker-compose 'monitoring' profile.
- Configures Prometheus to scrape the host-networked eBPF exporter.
- Disable PCIe ASPM to eliminate link-wake latency (critical for MoE expert fetching).
- Set CPU Energy Performance Bias (EPB) to 0 alongside performance governor.
- Add advanced GRUB GRUB_CMDLINE_LINUX documentation for isolcpus and nohz_full
  to completely isolate the CPU threads feeding the GPU.
- Added /usr/local/cuda/lib64/stubs to the linker path and LD_LIBRARY_PATH
  during the builder stage so libggml-cuda.so can link against libcuda.so.1
  inside the development container.
- Resolved Docker build warning regarding undefined $LD_LIBRARY_PATH variable.
…ibrary paths

Three root causes were breaking CI:

1. libcuda.so.1 transitive link error: The CUDA backend links against
   CUDA::cuda_driver which isn't available in the Docker build environment.
   Fix: use GGML_BACKEND_DL=ON to build CUDA as a dlopen'd module,
   matching the official llama.cpp Dockerfile approach.

2. Wrong COPY paths: Dockerfiles referenced build/ggml/src/ and build/src/
   but CMake outputs everything to build/bin/. Fix: COPY build/bin/ to /app/.

3. Additional fixes: GGML_NATIVE=OFF for GPU-less CI runners,
   GGML_CPU_ALL_VARIANTS=ON for broad CPU support, CUDA 12.9.1 base image,
   FROM...AS casing fix, and LD_LIBRARY_PATH undefined var warning.
@aWN4Y25pa2EK aWN4Y25pa2EK merged commit 54ae154 into main Mar 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant