Skip to content

Instantly share code, notes, and snippets.

View antferdom's full-sized avatar

A.J antferdom

View GitHub Profile
@jboner
jboner / latency.txt
Last active July 26, 2024 04:31
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@biera
biera / docker rm -all
Last active December 16, 2021 20:07
remove all docker containers
docker rm -f `docker ps -aq`
@ramn
ramn / socat_http_echo_server.sh
Last active September 26, 2023 12:22
Socat HTTP echo server
#!/bin/bash
socat -v -T0.05 tcp-l:8081,reuseaddr,fork system:"echo 'HTTP/1.1 200 OK'; echo 'Connection: close'; echo; cat"
@cubarco
cubarco / simplehttpserver.go
Created December 3, 2015 03:03
This is a golang alternative to the SimpleHTTPServer of Python.
package main
import (
"flag"
"fmt"
"net/http"
)
func main() {
var port string
@carlessanagustin
carlessanagustin / lists-dictionary.yml.md
Last active January 22, 2024 21:55
Lists & Dictionary YAML Syntax by example
@wolf1986
wolf1986 / Tensorflow Serving Tutorial - 01 - Public Inception Model.md
Last active November 10, 2023 13:33
Tutorial for Running Tensorflow Serving

Tensorflow Serving Tutorial - 01 - Public Inception Model

In this tutorial:

  • Start with a blank Ubuntu
  • Install requirements
  • Download code & pre-tranied inception-v3 model from Google
  • Export the downloaded "checkpoint" format to a TF Graph that is servable with Tensorflow Model Serving
  • Query the server with images of a cat and a dog

General Notes

  • Compiling Tensorflow Serving from source (on docker with their official instructions) produces an internal gcc error (probably specific to tensorflow commit / gcc version used when writing this: tf serving commit: c1ec43508ee57a5d6269116aba82d2a16d383c8a)
@nadavrot
nadavrot / Matrix.md
Last active July 21, 2024 17:27
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@mcandre
mcandre / brew-list-orphaned-packages.sh
Created September 7, 2018 21:32
Homebrew list orphaned packages
#!/bin/bash
brew list | while read cask; do echo -ne "\x1B[1;34m $cask \x1B[0m"; brew uses $cask --installed | awk '{printf(" %s ", $0)}'; echo ""; done
@mcarilli
mcarilli / commands.md
Last active June 11, 2024 20:13
Single- and multiprocess profiling workflow with nvprof and NVVP (Nsight Systems coming soon...)

Ordinary launch commands (no profiling):

Single-process:

python main_amp.py -a resnet50 --b 224 --deterministic --workers 4 --opt-level O1 ./bare_metal_train_val/

Multi-process:

python -m torch.distributed.launch  --nproc_per_node=2 main_amp.py -a resnet50 --b 224 --deterministic --workers 4 --opt-level O1 ./bare_metal_train_val/