This file contains 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
# before | |
def my_decorator(f): | |
def wrapper(*args, **kwds): | |
print('Calling decorated function') | |
return f(*args, **kwds) | |
return wrapper | |
# but why not | |
def my_decorator(f)(*args, **kwds): | |
print('Calling decorated function') |
This file contains 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 pty | |
import time | |
import os | |
import termios | |
import signal | |
import sys | |
import traceback | |
import threading | |
if len(sys.argv) > 1: |
This file contains 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
package main | |
var x interface{ f() } | |
type A struct { | |
fp func() | |
} | |
func (a A) f() { a.fp() } |
This file contains 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
#!/usr/bin/env python | |
import os | |
import time | |
import torch | |
import torch.distributed as dist | |
import torch.multiprocessing as mp | |
INTERVAL = 1 | |
COMM_SIZE = (10,) |
This file contains 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
{ | |
"Parameters": { | |
"ObjectStoreBucket": { | |
"Type": "String", | |
"Description": "A pre-existing S3 bucket to use for llama's object store" | |
}, | |
"ObjectStorePrefix": { | |
"Type": "String", | |
"Description": "A prefix in $ObjectStoreBucket under which to store objects", | |
"Default": "/", |
This file contains 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
# BoringSSL build times, Pixelbook | |
# `make -j5`, local compiler | |
real 2m40.180s | |
user 8m37.189s | |
sys 1m21.565s | |
# `ninja -j6`, local | |
real 2m35.987s | |
user 7m53.337s | |
sys 1m14.439s |
This file contains 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
b1: | |
%x1 = 1 | |
jmp b3 | |
b2: | |
%x2 = 2 | |
jmp b3 | |
b3: | |
%x3 = phi [b1, %x1], [b2, %x2] |
This file contains 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
/target |
This file contains 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
[nelhage@monolithique:~/code/alexbench]$ clang-11 -O1 -S -c -emit-llvm overflow_2.c | |
[nelhage@monolithique:~/code/alexbench]$ opt-11 --opt-bisect-limit=137 -O2 -S overflow_2.ll 2>/dev/null | opt-11 -O2 -S -o overflow_2_opt.ll | |
[nelhage@monolithique:~/code/alexbench]$ cat overflow_2_opt.ll | |
; ModuleID = '<stdin>' | |
source_filename = "overflow_2.c" | |
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-linux-gnu" | |
; Function Attrs: nofree nounwind uwtable | |
define dso_local { i8*, i64 } @f1_overflow() local_unnamed_addr #0 { |
This file contains 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
[package] | |
name = "f" | |
version = "0.1.0" | |
authors = ["Alex Gaynor <alex.gaynor@gmail.com>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
packed_simd = "0.3" |
NewerOlder