Skip to content

Instantly share code, notes, and snippets.

View ivanfioravanti's full-sized avatar

Ivan Fioravanti ivanfioravanti

View GitHub Profile
Benchmark started on 2025-10-19 22:52:10
** Command line:
/Users/ifioravanti/github/consumer-tflop-database/.venv/bin/python mamf-finder.py --m_range 0 16384 1024 --n_range 0 16384 1024 --k_range 0 16384 1024 --dtype bfloat16 --output_file=2025-10-19-22:52:09.txt
** Dtype: torch.bfloat16
** Platform/Device info:
- Darwin MacStudioIvan 25.1.0 Darwin Kernel Version 25.1.0: Sun Oct 5 21:09:25 PDT 2025; root:xnu-12377.40.120~10/RELEASE_ARM64_T6031 arm64 arm
@ivanfioravanti
ivanfioravanti / mlx_lm_benchmarks.md
Last active October 14, 2025 19:27 — forked from awni/mlx_lm_benchmarks.md
MLX LM Benchmarks

Benchmarks for mlx-lm

The command for evaluating on MMLU Pro:

mlx_lm.evaluate --model model/repo --task mmlu_pro

The command for efficiency benchmarks:

@ivanfioravanti
ivanfioravanti / batch_generate_response_multi_batches.py
Created September 27, 2025 15:59
batch_generate_response_multi_batches.py
"""Run four batched generations with varying sampling settings."""
import argparse
import mlx.core as mx
from mlx_lm import batch_generate, load
from mlx_lm.sample_utils import make_sampler
#!/usr/bin/env python3
"""
MLX benchmark script that replicates llama-bench behavior exactly.
Uses random tokens for both prompt and generation, no sampling.
"""
import mlx.core as mx
import mlx_lm
from mlx_lm.models.cache import make_prompt_cache
import time
@ivanfioravanti
ivanfioravanti / game.py
Last active July 22, 2025 20:58
Triangle-Square-Pentagon Rotation Game
import pygame
import math
import random
# Initialize pygame
pygame.init()
# Screen dimensions
WIDTH, HEIGHT = 800, 800
screen = pygame.display.set_mode((WIDTH, HEIGHT))
@ivanfioravanti
ivanfioravanti / animation.html
Created February 25, 2025 06:06
Interactive Particle Animation Sonnet 3.7
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>P5.js Particle Animation</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js"></script>
<style>
body {
margin: 0;
@ivanfioravanti
ivanfioravanti / o1.py
Created January 22, 2025 11:15
o1-pro vs r1 rotating square with ball inside
import pygame
import math
import sys
pygame.init()
# Screen setup
WIDTH, HEIGHT = 800, 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Bouncing Ball in Rotating Square")
@ivanfioravanti
ivanfioravanti / mlx_memory.sh
Created January 4, 2025 16:42
Script to set MLX memory limits
#!/usr/bin/env bash
# Default values for percentages
DEFAULT_WIRED_LIMIT_PERCENT=85
DEFAULT_WIRED_LWM_PERCENT=75
# Read input parameters or use default values
WIRED_LIMIT_PERCENT=${1:-$DEFAULT_WIRED_LIMIT_PERCENT}
WIRED_LWM_PERCENT=${2:-$DEFAULT_WIRED_LWM_PERCENT}
@ivanfioravanti
ivanfioravanti / asteroids.py
Created December 25, 2024 19:06
Asteroids with DeepSeek V3 chat.
import pygame
import random
import math
import os
# Initialize Pygame
pygame.init()
# Screen dimensions
WIDTH, HEIGHT = 800, 600
@ivanfioravanti
ivanfioravanti / convert_archive.py
Created November 17, 2024 23:19 — forked from deepfates/convert_archive.py
Convert your twitter archive into a training dataset and markdown files
import argparse
import json
import logging
import os
import re
import shutil
from concurrent.futures import ProcessPoolExecutor, as_completed
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple