This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
keptn42 cc46e3b714 core/mm: the Radio image family and video tubelets
Nemotron-H Omni's processor: NVIDIA's size rule for one tile, torch's antialiased bicubic on float
pixels, patches in merge-block order, and video in tubelets labelled as the reference labels them.
A picture and a video frame share one patch row, so one embedding GEMM serves both. mm_test against
golden rows.
2026-11-04 22:08:53 +01:00

48 lines
4.1 KiB
C++

/* radio_golden.h -- from NVIDIA's image_processing_nemotron_h_omni.py (its _compute_target_patches
* and _compute_target_patches_video, verbatim, at the checkpoint's preprocessor_config.json) and
* torch 2.11's F.interpolate(bicubic, align_corners=False, antialias=True); do not edit. */
#pragma once
#include <cstdint>
static const int32_t kRadioPatch = 16, kRadioMerge = 2, kRadioMinP = 1024, kRadioMaxP = 13312;
static const int32_t kRadioMaxLen = 16384, kRadioVideoP = 1024;
/* A w x h picture's tile (pw x ph patches) and a video frame's (vw x vh). */
struct GoldRadioSize { int64_t w, h; int32_t pw, ph, vw, vh; };
static const GoldRadioSize kGoldRadioSize[] = {
{ 1, 1, 32, 32, 32, 32 },
{ 16, 16, 32, 32, 32, 32 },
{ 48, 48, 32, 32, 32, 32 },
{ 800, 400, 50, 26, 44, 22 },
{ 768, 512, 48, 32, 38, 26 },
{ 800, 560, 50, 36, 38, 26 },
{ 896, 640, 56, 40, 38, 26 },
{ 640, 720, 40, 46, 30, 34 },
{ 1920, 1080, 120, 68, 42, 24 },
{ 1080, 1920, 68, 120, 24, 42 },
{ 3840, 2160, 154, 86, 42, 24 },
{ 4000, 3000, 132, 100, 36, 28 },
{ 512, 512, 32, 32, 32, 32 },
{ 496, 496, 32, 32, 32, 32 },
{ 500, 333, 40, 26, 38, 26 },
{ 4096, 64, 256, 4, 256, 4 },
{ 64, 4096, 4, 256, 4, 256 },
{ 1000, 1000, 64, 64, 32, 32 },
{ 1600, 48, 160, 8, 184, 6 },
{ 33, 17, 40, 28, 44, 22 },
{ 2048, 2048, 116, 114, 32, 32 },
{ 1280, 720, 80, 46, 42, 24 },
{ 720, 1280, 46, 80, 24, 42 },
{ 240, 160, 42, 26, 38, 26 },
{ 2560, 1440, 154, 86, 42, 24 },
{ 1824, 1824, 114, 114, 32, 32 },
{ 1840, 1840, 116, 114, 32, 32 },
};
/* A 7 x 5 picture, channel c of pixel (x, y) = (37 x + 11 y + 53 c) mod 256, resized as float to
* 4 x 3 and to 9 x 6: [h, w, 3]. Shrinking widens the filter; growing overshoots 0..255. */
static const float kGoldRadioAa43[] = {
18.68736f, 71.68737f, 124.68736f, 80.90739f, 133.72572f, 194.65350f, 148.87723f, 213.02129f, 152.70291f, 211.09726f, 126.56811f, 55.45514f, 36.79506f, 89.79505f, 142.43031f, 99.01508f, 156.68340f, 218.53284f, 166.63049f, 187.91020f, 85.37108f, 234.45689f, 48.12016f, 68.77328f, 54.90274f, 107.90273f, 166.63322f, 117.12276f, 176.20847f, 186.10544f, 190.66121f, 193.38731f, 58.40165f, 164.79666f, 38.00973f, 93.24097f };
static const float kGoldRadioAa96[] = {
-2.15752f, 50.84248f, 103.84248f, 22.05824f, 75.05824f, 128.05823f, 53.03841f, 106.03841f, 159.03842f, 81.81619f, 134.81619f, 187.63474f, 110.59396f, 163.59395f, 216.59395f, 139.37173f, 192.37170f, 271.01746f, 168.14951f, 238.70782f, 133.00426f, 199.12965f, 169.84392f, 30.16899f, 223.34544f, 8.22708f, 73.34544f, 6.05768f, 59.05768f, 112.05769f, 30.27345f, 83.27344f, 136.27345f, 61.25361f, 114.25362f, 167.25362f, 90.03139f, 143.03140f, 199.85938f, 118.80916f, 171.80916f, 224.80916f, 147.58691f, 199.40474f, 92.79315f, 176.36472f, 258.14157f, 39.83767f, 207.34486f, 191.24995f, 53.29689f, 231.56065f, 15.60972f, 81.56065f, 15.66519f, 68.66520f, 121.66520f, 39.88095f, 92.88096f, 145.88097f, 70.86112f, 123.86114f, 176.86115f, 99.63892f, 152.63893f, 210.80418f, 128.41669f, 181.41669f, 234.41670f, 157.19443f, 220.58044f, 40.21658f, 185.97224f, 157.96931f, 15.63081f, 216.95239f, 71.77780f, 67.87831f, 241.16818f, 33.36428f, 91.16816f, 24.83185f, 77.83186f, 130.83186f, 49.04762f, 102.04762f, 155.04762f, 80.02779f, 133.02780f, 185.31654f, 108.80557f, 161.80557f, 222.22914f, 137.58333f, 190.58334f, 256.54630f, 166.36110f, 237.78807f, 63.46646f, 194.24980f, 90.82895f, 30.38097f, 230.28572f, -8.77776f, 76.11905f, 263.91144f, 48.19390f, 100.33482f, 34.43936f, 87.43935f, 140.43936f, 58.65512f, 111.65513f, 164.65514f, 89.63529f, 142.63531f, 198.74486f, 118.41308f, 171.41309f, 218.36819f, 147.19084f, 200.19084f, 196.51909f, 175.96861f, 246.17574f, 59.60552f, 208.63335f, 112.01243f, 43.80931f, 217.51062f, 14.44085f, 85.72655f, 200.58788f, 56.94232f, 109.94233f, 42.65456f, 95.65456f, 148.65459f, 66.87033f, 119.87034f, 172.87033f, 97.85049f, 150.85052f, 218.41563f, 126.62828f, 179.62830f, 186.20245f, 155.40605f, 208.40605f, -4.04360f, 184.18382f, 254.39093f, 27.43979f, 231.16805f, 120.22764f, 63.48009f, 158.61864f, 22.65605f, 93.94176f, -9.85780f, 65.15753f, 118.15753f };