This file contains hidden or 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
| -- Neovim color file | |
| -- Port of: 256-grayvim | |
| -- Clear highlights and set basic options | |
| vim.cmd("highlight clear") | |
| if vim.fn.exists("syntax_on") then | |
| vim.cmd("syntax reset") | |
| end | |
| vim.o.background = "dark" |
This file contains hidden or 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 itertools | |
| from collections import defaultdict | |
| from contextlib import nullcontext | |
| from dataclasses import asdict, dataclass | |
| from typing import Callable, List, Tuple | |
| from tabulate import tabulate | |
| from tqdm import tqdm | |
| import torch |
This file contains hidden or 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 contextlib | |
| from torch.nn.functional import scaled_dot_product_attention | |
| from torch.nn.attention import sdpa_kernel, SDPBackend | |
| ctxmgr = contextlib.nullcontext() | |
| # ctxmgr = sdpa_kernel(backends=[SDPBackend.EFFICIENT_ATTENTION]) | |
| # ctxmgr = sdpa_kernel(backends=[SDPBackend.FLASH_ATTENTION]) | |
| # ctxmgr = sdpa_kernel(backends=[SDPBackend.MATH]) | |
| # ctxmgr = sdpa_kernel(backends=[SDPBackend.CUDNN_ATTENTION]) |
This file contains hidden or 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
| # Install to /opt/gcc-8 | |
| # Do NOT install to /usr/local, because of libstdc++.so.6 naming conflict. | |
| # Your system's compiler are likely incompatible with it. | |
| # There is also no "library-suffix" option. So simply don't install it there. | |
| # Optionally you can add --program-suffix=-8 but this creates quite a few troubles for Matlab to detect GCC. | |
| ../gcc-8.4.0/configure --prefix=/opt/gcc-8 --enable-bootstrap --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --build=x86_64-redhat-linux --disable-multilib | |
| # Important. Run this in your shell before "make", otherwise there will be various weird erros. | |
| # Don't know why gcc don't make this default. |
This file contains hidden or 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
| #!/bin/bash | |
| tail --pid=$1 -f /dev/null |
This file contains hidden or 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
| /* | |
| hamming.cpp: a C++ version for calculating hamming numbers, aka regular numbers, | |
| aka ugly numbers, in compile time (using template meta programming). | |
| Copyright (C) 2008 Daniel Gutson | |
| hamming.cpp is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU Affero General Public License as | |
| published by the Free Software Foundation, either version 3 of the | |
| License, or (at your option) any later version. |
This file contains hidden or 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 python3 | |
| ''' | |
| Copyright © 2020, 2021 Xinya Zhang <xinyazhang@utexas.edu> | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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 python3 | |
| import argparse | |
| def parse(): | |
| p = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
| p.add_argument('example', help='Example usage of parser', type=float, default=0.0) | |
| args = p.parse_args() | |
| # print(args) | |
| return args |
This file contains hidden or 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
| python3 -c 'import tensorflow as tf; c = tf.constant("Testing"); sess = tf.Session(); print(sess.run(c)); print(tf.test.gpu_device_name())' |