Archived
gemma4_bf16's block structure with Gemma 3's differences (modeling_gemma3, transformers 4.57): GemmaRMSNorm everywhere, one head geometry, scores at query_pre_attn_scalar^-0.5, linear rotary scaling on the global layers only, the bf16-held embedding scale, no value norm, soft-capping and YaRN refused. Linears i8a8, mxfp4a8 and w4a8i8_asym over an activation scaled per (row, 128), beside bf16 and w4a8 / w8a8: one int8 scale a row costs KL 0.097 at w8a8 on Gemma 3's outlier channels. Fused junctions on a quantised trunk. A calibration tap (RADIANCE_CALIB_DIR, RADIANCE_G3_CALIB_LAYERS), the column-split linears as rank parts. A DFlash2 drafter as qwen35_fp8 declares one; rad_block_dflash2.h applies the drafter's input_embedding_scale through embed_lookup's mult when it is not 1, so other drafters' graphs are unchanged. Against transformers' float32 forward on a tiny Gemma 3: KL 0.00016 on the host backend and the cards. arch_test: 7 cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
430 B
CMake
11 lines
430 B
CMake
# Built in radiance's tree, or standalone against an installed radiance
|
|
# (`cmake -S arch/gemma3 -B build -DCMAKE_PREFIX_PATH=<radiance prefix>`); see cmake/RadAddPlugin.cmake.
|
|
if(NOT COMMAND rad_add_plugin)
|
|
cmake_minimum_required(VERSION 3.21)
|
|
project(gemma3 LANGUAGES CXX)
|
|
find_package(radiance REQUIRED)
|
|
rad_plugin_defaults()
|
|
endif()
|
|
|
|
rad_add_plugin(gemma3 architectures SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/gemma3.cpp)
|