Skip to content

Instantly share code, notes, and snippets.

View Steboss's full-sized avatar

Steboss Steboss

View GitHub Profile
@Steboss
Steboss / edgeai_true_false.csv
Created July 1, 2026 10:30
what's true and false in edge AI
Claim Why isn't true Correct claim
It fits because the file fits The file is the weight payload at one precision. Peak memory also includes activations, workspace, and a KV cache that grows linearly with the context Fit is undetermined wihtout context length and runtime overhead
Parameter count equals memory usage The weight payload should be used, it depends on the precision, wegiths are resident, activations and KV come and go Peak is runtime-specific
FLOPS decide latency FLOPs ignore data movement. A decode step and a prefill step over the same weights do identical airthmetic but differ in intensity The number of tokens M is what decide everything about memory and compute-bound cases
Claim, Why isn't true, Correct claim
"It fits because the file fits", "The file is the weight payload at one precision. Peak memory also includes activations, workspace, and a KV cache that grows linearly with the context", "Fit is undetermined wihtout context length and runtime overhead"
@Steboss
Steboss / gist:90850e0d9e23822fc5073d16aae824ae
Created July 1, 2026 10:26
edgeai_true_false_claims.csv
Claim, Why isn't true, Correct claim
"It fits because the file fits", "The file is the weight payload at one precision. Peak memory also includes activations, workspace, and a KV cache that grows linearly with the context", "Fit is undetermined wihtout context length and runtime overhead"
@Steboss
Steboss / iteration_4.rs
Created January 16, 2026 10:36
Final iteration where the model starts to use a more neon-like style
use rayon::prelude::*;
use std::arch::aarch64::*;
use std::env;
use std::fs;
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 4 {
eprintln!("Usage: {} M K N", args[0]);
return;
@Steboss
Steboss / iteration_0.rs
Created January 16, 2026 10:35
First iteration from the model. It generates a Strassen algorithm
use rayon::prelude::*;
use std::env;
const N: usize = 2; // Fixed block size
// HELPER: Convert slice to fixed array for safety (optional but good for debugging)
fn to_array(slice: &[f64]) -> [f64; N * N] {
slice.try_into().expect("Slice has incorrect length")
}
@Steboss
Steboss / matmulmanager.py
Created January 16, 2026 10:25
Matrix Multiplication Autogen's manager to orchestrate all the agents
import logging
import re
from typing import List
from autogen_core import (
DefaultTopicId,
MessageContext,
RoutedAgent,
message_handler,
)
@Steboss
Steboss / basematmulagent.py
Created January 16, 2026 10:13
Base Autogen's class for agents workflows
import logging
import json
from typing import List
from autogen_core import (
DefaultTopicId,
MessageContext,
RoutedAgent,
message_handler,
)
@Steboss
Steboss / semantic_chunker.py
Created January 16, 2026 10:02
Create a vector database with semantic chunker
import os
import re
import glob
import pymupdf4llm
from marker.converters.pdf import PdfConverter
from marker.models import create_model_dict
from marker.output import text_from_rendered
from langchain_core.documents import Document
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_experimental.text_splitter import SemanticChunker
class BaseMatMulAgent(RoutedAgent):
"""
A generic agent that can handle RequestToSpeak, call tools, and publish messages.
"""
def __init__(
self,
description: str,
group_chat_topic_type: str,
model_client: ChatCompletionClient,
system_message: str,
@Steboss
Steboss / submit2.sh
Created June 5, 2025 09:29
detailed version of submit file
#!/bin/bash
#SBATCH -A your_account
#SBATCH -p your_partition
#SBATCH -N 4 # example with 4 nodes
#SBATCH -t 04:00:00 # max run time
#SBATCH -J "something_in_line_with_your_system"
export CONFIG="fuji-70B-v2-flash" # here you can insert, for example, fuji-7B-v2-flash
export CONTAINER="ghcr.io/nvidia/jax:axlearn" # this is our public jax-axlearn container