This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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) | |
| // |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |