Skip to content

Instantly share code, notes, and snippets.

View JyotinderSingh's full-sized avatar
:octocat:
Building and breaking things

Jyotinder Singh JyotinderSingh

:octocat:
Building and breaking things
View GitHub Profile
@JyotinderSingh
JyotinderSingh / s1.py
Created July 24, 2026 03:13
Keras GPTQ Phase0: calibration batching benchmark (s1) + dense-inv vs Cholesky quality gate (s2)
"""GPTQ calibration wall-time benchmark: batched vs unbatched forwards.
Builds a synthetic 4-block transformer (d_model=512, ffn=2048, EinsumDense
attention projections) and runs full GPTQ calibration over ~128 synthetic
calibration sequences of length 128 (no downloads).
"old" == calibration_batch_size=1 (reproduces the pre-change per-sample
forward pattern). "new" == calibration_batch_size=8 (the new default). The
Cholesky inverse-Hessian change is orthogonal and per-layer (negligible vs the
forward passes), so this isolates the calibration-forward speedup from batching.
@JyotinderSingh
JyotinderSingh / after_branch.txt
Created July 24, 2026 03:01
keras int4 mode unification: string vs Int4QuantizationConfig() resolve identically (grouped g128); before/after shows int4/None_from_* checkpoint now loads. Run: KERAS_BACKEND=jax PYTHONPATH=<worktree> python verify_int4.py
===== A. STRING quantize('int4') =====
dtype_policy: int4/128_from_float32
_int4_block_size: 128
var bias shape=(64,) dtype=float32
var kernel shape=(256, 32) dtype=int8
var kernel_scale shape=(2, 64) dtype=float32
var kernel_zero shape=(2, 64) dtype=int8
var g_idx shape=(256,) dtype=float32
output[0,:5]: [-0.75887 -0.52892 -0.41521 -1.82848 -0.12788]
output sum: -15.898343086242676
@JyotinderSingh
JyotinderSingh / awq_fidelity_eval.py
Created July 24, 2026 03:00
Keras AWQ fidelity: OLD vs NEW reconstruction error + end-to-end transformer KL/top-1
"""Evidence: OLD vs NEW Keras AWQ fidelity.
Compares the previous Keras AWQ algorithm (running-MAX activation statistic,
scale = x_max**ratio only, no weight clipping) against the reference-aligned
implementation on this branch (running-MEAN activation statistic, reference
scale formula x_stat**ratio / w_stat**(1-ratio), plus AutoAWQ-style per-group
weight clipping).
Two metrics:
(a) Per-layer activation-weighted reconstruction error
#!/usr/bin/env python3
"""One-off benchmark for Data.content_hash().
Creates temporary datasets on disk, then times content_hash().
Usage:
python bench_content_hash.py
python bench_content_hash.py --files 50000 --total-mb 500
"""
@JyotinderSingh
JyotinderSingh / dense.py
Created August 6, 2025 08:18
Modularized GPTQ logic
class Dense(Layer):
...
def get_gptq_handler(self) -> "GPTQHandler":
"""Provides a GPTQHandler for a standard Dense layer."""
return GPTQHandler(
kernel=self.kernel,
bias=self.bias,
rows=self.kernel.shape[0],
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/dicedb/dicedb-go"
@JyotinderSingh
JyotinderSingh / leaderboard.go
Created October 12, 2024 15:02
leaderboard
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"math/rand"
"net/http"
"os"
@JyotinderSingh
JyotinderSingh / script.sh
Created April 11, 2024 06:40
Jupyter Notebook Auto Complete: Install hinterland for conda
conda activate <env_name>
conda install -c conda-forge jupyter_contrib_nbextensions
jupyter nbextensions_configurator enable --user
jupyter contrib nbextension install --user
jupyter nbextension enable hinterland/hinterland
@JyotinderSingh
JyotinderSingh / oktaLogin.js
Created December 16, 2021 07:03 — forked from ndavis/oktaLogin.js
Cypress Custom Command for Okta Login
Cypress.Commands.add('loginOkta', () => {
const optionsSessionToken = {
method: 'POST',
url: Cypress.env('session_token_url'),
body: {
username: Cypress.env('username'),
password: Cypress.env('password'),
options: {
warnBeforePasswordExpired: 'true'
}
diff --git a/compiler/build.gradle b/compiler/build.gradle
index 60d3a436f..409df7a03 100644
--- a/compiler/build.gradle
+++ b/compiler/build.gradle
@@ -31,6 +31,7 @@ def addLibraryIfNotLinked = { libName, argList ->
}
def String arch = rootProject.hasProperty('targetArch') ? rootProject.targetArch : osdetector.arch
+// arch = arch.replace('osx_arm-v8', 'osx_aarch64')
def boolean vcDisable = rootProject.hasProperty('vcDisable') ? rootProject.vcDisable : false