Skip to content

Instantly share code, notes, and snippets.

View catid's full-sized avatar

Chris Taylor catid

View GitHub Profile
@catid
catid / test_gmm_gpt4.py
Created March 23, 2024 23:33
GIVT GMM Decoder (GPT-4)
# Collaboration between Claude-3 and GPT-4 to implement https://arxiv.org/pdf/2312.02116.pdf
# This is just the GMM decoder part of the model they propose (which is the new thing).
# This one was mainly generated by GPT-4.
# The AIs provided two implementations of the idea and revised eachothers' code.
# I tested that the unit tests pass but haven't tried it in a language model yet.
import torch
import torch.nn as nn
import torch.nn.functional as F
@catid
catid / test_gmm_claude3.py
Created March 23, 2024 23:30
GIVT GMM Decoder (Claude 3)
# Collaboration between Claude-3 and GPT-4 to implement https://arxiv.org/pdf/2312.02116.pdf
# This is just the GMM decoder part of the model they propose (which is the new thing).
# This one was mainly generated by Claude-3.
# The AIs provided two implementations of the idea and revised eachothers' code.
# I tested that the unit tests pass but haven't tried it in a language model yet.
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import math
#torch.autograd.set_detect_anomaly(True)
class FeedForward(torch.nn.Module):
def __init__(self, input_features, output_features):
@catid
catid / gist:7705835601ea71e4588652135a3a587e
Last active February 16, 2024 01:07
DoRA the explora
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
# This layer is dropped into your pre-trained PyTorch model where nn.Linear is used
class DoRALayer(nn.Module):
def __init__(self, d_in, d_out, rank=4):
super().__init__()
@catid
catid / z_calibration
Created April 1, 2022 03:42
z_calibration
#####################################################################
# Auto Z-Calibration
#####################################################################
[z_calibration]
probe_nozzle_x: 175.5
probe_nozzle_y: 257
# The X and Y coordinates (in mm) for clicking the nozzle on the
# Z endstop.
probe_switch_x: 169.3
@catid
catid / print_start
Created March 24, 2022 19:18
print_start
[gcode_macro PRINT_START]
gcode:
M117 Print Starting...
; Make sure we are not applying stale bed mesh or Z offset
SET_GCODE_OFFSET Z=0
BED_MESH_CLEAR
; Start heating bed
@catid
catid / printer.cfg
Created March 18, 2022 21:26
printer.cfg
[gcode_macro PRINT_START]
gcode:
M117 Print Starting...
; Make sure we are not applying stale bed mesh or Z offset
SET_GCODE_OFFSET Z=0
BED_MESH_CLEAR
; Start heating bed
@catid
catid / printer.cfg
Created March 16, 2022 08:13
printer.cfg
[include mainsail.cfg]
[include timelapse.cfg]
# This file contains common pin mappings for the BigTreeTech Octopus V1.
# To use this config, the firmware should be compiled for the STM32F446 with a "32KiB bootloader"
# Enable "extra low-level configuration options" and select the "12MHz crystal" as clock reference
# after running "make", copy the generated "klipper/out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the OctoPus with that SD card.
x264_param_t param;
x264_param_default_preset(&param, "veryfast", "zerolatency");
param.rc.i_rc_method = X264_RC_ABR;
param.rc.i_bitrate = kbps_bitrate;
param.i_width = width;
param.i_height = height;
param.i_fps_num = fps;
param.i_fps_den = 1;
param.i_csp = X264_CSP_I420;
GPD Win Max 2021 CPU-Z Benchmark Results
Seems worth setting TDP lower on Win Max 2021.
Single-threaded: Up to 50% faster.
Multi-threaded: Up to 22% faster.
BIOS: TDP Down (15 W)
Windows: Best Power Efficiency
Single-thread: 405.8