Skip to content

Instantly share code, notes, and snippets.

Avatar

Phung Cheng Fei buttercutter

View GitHub Profile
View quantize_interpreter.py
from collections import defaultdict
from copy import deepcopy
from functools import partial, reduce
import numpy as np
import warnings
import jax
import jax.numpy as jnp
from jax._src.core import Literal
from jax.util import safe_map
View debug_model_parallelism.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View GPT_J_6B_Inference_Demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@buttercutter
buttercutter / toffoli_gate_simplified.tex
Created February 22, 2023 05:02
toffoli gate optimization
View toffoli_gate_simplified.tex
\documentclass{article}
\usepackage{amsmath}
\NewDocumentCommand{\Qubit}{ O{1} }{%
\ensuremath{%
\mathbf{%
#1%
}%
}%
}
View vqe_co2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@buttercutter
buttercutter / neopi.py
Last active January 11, 2023 06:08
A refactored neopi.py script
View neopi.py
#!/usr/bin/python
# Name: neopi.py
# Description: Utility to scan a file path for encrypted and obfuscated files
# Authors: Ben Hagen (ben.hagen@neohapsis.com)
# Scott Behrens (scott.behrens@neohapsis.com)
#
# Date: 11/4/2010
#
# pep-0008 - Is stupid. TABS FO'EVER!
@buttercutter
buttercutter / run_summarization_flax.py
Last active January 11, 2023 03:24
flax training script with gradient accumulation trick
View run_summarization_flax.py
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
View WGAN.py
import imageio
import numpy as np
import torch
import torch.nn as nn
from torchvision.utils import make_grid
from torch.autograd import Variable
from torch.autograd import grad as torch_grad
import sequence_dataloader
@buttercutter
buttercutter / PKGBUILD
Created October 3, 2021 08:08
PKGBUILD for Modelsim
View PKGBUILD
pkgname=modelsim
# Keep dot in _patchver
_mainver=20.1; _patchver=.1; _buildver=720
pkgver=${_mainver}${_patchver}.${_buildver}
pkgrel=1
# According to the installer script, these dependencies are needed for the installer
depends=('ld-lsb' 'lib32-expat' 'lib32-fontconfig' 'lib32-freetype2' 'lib32-glibc'
'lib32-gtk2' 'lib32-libcanberra' 'lib32-libpng' 'lib32-libice' 'lib32-libsm'
View Sub-1_Volt_OTA.asc

Version 4 SHEET 1 2232 772 WIRE -96 -240 -128 -240 WIRE 48 -240 -16 -240 WIRE 96 -240 48 -240 WIRE 224 -240 176 -240 WIRE 704 -192 704 -240 WIRE 1216 -192 1216 -240 WIRE 1728 -176 1728 -224 WIRE 1920 -176 1920 -224