Skip to content

Instantly share code, notes, and snippets.

View maderix's full-sized avatar

Manjeet Singh maderix

View GitHub Profile
@maderix
maderix / ane_prefill_pipeline.m
Last active May 14, 2026 08:39
ANE Prefill Pipeline — Qwen 3.5 9B on Apple M4 (221 tok/s, 5.05 TFLOPS, FP16)
// Qwen 3.5 9B Prefill Pipeline — ANE (Apple Neural Engine)
//
// 221 tok/s prefill, 5.05 TFLOPS ANE, FP16 weights, no quantization.
// Apple M4 (10-core: 4P+6E), 24 GB, macOS 15.
// Single self-contained file. No external dependencies beyond Apple frameworks.
//
// Architecture (32 layers, 24 DeltaNet + 8 Attention):
// DeltaNet: QKV proj (ANE) → recurrence (CPU/OpenMP) → out proj (ANE) → FFN (ANE)
// Attention: Q/K/V proj (ANE) → causal SDPA (CPU/AMX) → O proj (ANE) → FFN (ANE)
//
@maderix
maderix / numpy_raytracer.ipynb
Last active June 5, 2020 11:58
numpy_raytracer.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maderix
maderix / python_gpu_ray_tracing.ipynb
Created June 5, 2020 11:52
python_gpu_ray_tracing.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maderix
maderix / ray_tracer.ipynb
Created May 31, 2020 17:10
ray_tracer.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maderix
maderix / crop_video.py
Created April 18, 2020 11:36
Get frames from video file, crop and save them
import cv2
cap = cv2.VideoCapture('video.mp4')
count = 0
while cap.isOpened():
ret, frame = cap.read()
if ret:
h,w = frame.shape[0],frame.shape[1]
if h > w: