Skip to content

Instantly share code, notes, and snippets.

View Maharshi-Pandya's full-sized avatar
:shipit:
you can just do things

Maharshi Pandya Maharshi-Pandya

:shipit:
you can just do things
View GitHub Profile
@Maharshi-Pandya
Maharshi-Pandya / quant.py
Last active November 10, 2025 03:23
NVFP4 quantization in torch
import torch
FP8_AMAX = 448.0
FP8_DTYPE = torch.float8_e4m3fn
FP4_AMAX = 6.0
FP4_DTYPE = getattr(torch, "float4_e2m1fn_x2", torch.uint8)
# midpoints and the corresponding bins
# representable positives = [0.0, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0]
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active November 16, 2025 09:53
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference