Skip to content

added hybrid var with diffusion model and mapping txt prompt to imageClassNet#165

Open
poovarasansivakumar2003 wants to merge 1 commit into
FoundationVision:mainfrom
poovarasansivakumar2003:main
Open

added hybrid var with diffusion model and mapping txt prompt to imageClassNet#165
poovarasansivakumar2003 wants to merge 1 commit into
FoundationVision:mainfrom
poovarasansivakumar2003:main

Conversation

@poovarasansivakumar2003

Copy link
Copy Markdown

No description provided.

jasonpan0930 added a commit to jasonpan0930/VAR_PolarQuant that referenced this pull request Jun 19, 2026
Add `quant_v` flag to switch between K-only and K+V polar quantization
at inference time, and infrastructure for separate K/V kmeans codebooks.

Model changes (models/basic_var.py, models/var.py):
- SelfAttention.kv_caching() gains `quant_v: bool` parameter
- When polar_config is set but quant_v=False, V stays standard FP16 cache
- All other call sites default quant_v=True (backward compatible)
- autoregressive_infer_cfg reads self.quant_v (set by set_polar_quant)

Experiment scripts:
- exp/exp_fid_sample.py: --quant-v/--no-quant-v CLI, auto-load V codebook
- exp/exp_cross_block_cumulative_mse.py: --quant-v/--no-quant-v,
  depth-30 codebook paths, output files tagged _KV_ or _Konly_
- exp/exp_theta2_kmeans.py: --collect-v for V-specific kmeans fitting,
  L0-only theta2 collection
- exp/sbatch_fid_sample.sh: QUANT_V env var forwarded to script

Codebook registry (utils/angle_quant.py):
- register_theta2_kmeans_codebook_v() for V-specific codebook
- register_theta2_kmeans_codebook() unchanged (K)

Angle statistics (utils/polar_angle_viz.py):
- record_v() method for V-vector theta2 collection
- aggregate_theta2_mse_for_kmeans_v() aggregator
- Only L0 theta2 (first 16) collected for kmeans (per user feedback)
- Fix: .cpu().numpy() on CUDA tensors in record_v
- Fix: KeyError guard in aggregate_k_errors for dim_mean_abs_full

Evaluator fix (guided-diffusion/evaluations/evaluator.py):
- Shuffle preds before IS split to avoid underestimation when
  samples are ordered by class (OpenAI issue FoundationVision#165)
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