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
#include <iostream> | |
#include <chrono> | |
#include <vector> | |
#include <random> | |
#include <iomanip> | |
#include <cmath> | |
#include <cassert> | |
// E4M3 FP8 Format (NVIDIA standard) | |
// 1 bit sign, 4 bits exponent, 3 bits mantissa |
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 time | |
from vllm import LLM, SamplingParams | |
import lmdeploy | |
# Test prompts for real-world language use cases | |
PROMPTS = [ | |
"Explain quantum computing in simple terms.", | |
"What is the future of renewable energy?", | |
"Describe the Great Wall of China.", | |
"Why is the sky blue?", |
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 base64, time, sys | |
encoded_resume = b""" | |
TmFtZTogU3VwcmVldCBTZXRoaQpTdW1tYXJ5OiBCdWlsZGVyIG9mIHNjYWxhYmxlIEFJICYgQ2xvdWQgcGxhdGZvcm1zLCBkZWxpdmVyaW5nIGluZnJhIGZvciAyJSBvZiBTRUEgR0RQLgogRXhwZXJpZW5jZToKICAoMSkgVlAsIEFJIFNvbHV0aW9ucywgRTJFTmV0d29ya3MKICAoMikgRGlyZWN0b3IsIENvdWNoYmFzZSBBUEFDCiAgKDMpIFNwZWNpYWxpc3QgTGVhZGVyICYgSGVhZCBTdGFydHVwIFNBLCBBV1MgQVNFQU4KICAoNCkgUHJpbmNpcGFsIFNBLiBBV1MKICAoNSkgSGVhZCBvZiBFbmdpbmVlcmluZywgU21hcnRrYXJtYQogICg2KSBTVlAgRW5naW5lZXJpbmcsIFJhbGFsaQogICg3KSBUZWNobmljYWwgQXJjaGl0ZWN0LCBUb2tvcGVkaWEKTG9uZy1UZXJtIElucGFjdDoKICAtIFJlZHVjZWQgQUkgaW5mcmEgc2V0dXAgdGltZSA2NSDihpAgMTUgZGF5cwogIC0gSW5jcmVhc2VkIHBlcmZvcm1hbmNlIDIw4oCTMjUlIHdpdGggR3Jhdml0b24yCiAgLSBEZWNyZWFzZWQgY2xvdWQgY29zdHMgYnkgNDAlClNraWxsczogQ2xvdWQtTmF0aXZlIFN0cmF0ZWd5LCBHZW5BSSwgRGlzdHJpYnV0ZWQgU3lzdGVtcywgR3Jvd3RoIExlYWRlcnNoaXAK | |
""" | |
banner = r""" | |
____ _ | |
/ ___|___ _ __ ___ _ __ ___ ___| |_ |
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 torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig | |
model_name_or_path = "IntervitensInc/pangu-pro-moe-model" | |
generation_config = GenerationConfig( | |
do_sample=True, | |
top_k=50, | |
top_p=0.95, | |
temperature=0.6 |
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
const { | |
Worker, | |
isMainThread, | |
parentPort, | |
workerData, | |
MessageChannel, | |
} = require("node:worker_threads"); | |
const http = require("node:http"); | |
if (isMainThread) { |
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 matplotlib.pyplot as plt | |
import pandas as pd | |
import re | |
def parse_gc_log(gc_log): | |
# Split the input log by lines | |
lines = gc_log.split("\n") | |
# Prepare lists for each graph's data | |
gc_timing = [] |
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/sh | |
lsb_release -a | |
add-apt-repository ppa:deadsnakes/ppa --yes | |
apt install python3.11 python3.11-venv python3.11-dev | |
python3.11 -m venv env | |
source env/bin/activate | |
pip install packaging wheel | |
pip install https://download.pytorch.org/whl/cu124/torch-2.6.0%2Bcu124-cp311-cp311-linux_x86_64.whl#sha256=d4c3e9a8d31a7c0fcbb9da17c31a1917e1fac26c566a4cfbd8c9568ad7cade79 | |
pip install --no-build-isolation 'instructlab[cuda]' -C cmake.args="-DLLAMA_CUDA=on" -C cmake.args="-DLLAMA_NATIVE=off" |
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
const users = [ | |
{ id: 'user_111', email: '[email protected]' }, | |
{ id: 'user_222', email: '[email protected]' }, | |
{ id: 'user_333', email: '[email protected]' }, | |
] | |
// Wait for all the get operations to complete and store the results. | |
const getResults = await Promise.all( | |
users.map((user) => { | |
console.log(`Getting document: ${user.id}`) | |
return usersCollection.get(user.id, user) |
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 time | |
import random | |
from pymongo import MongoClient | |
from couchbase.cluster import Cluster | |
from couchbase.management.buckets import BucketManager | |
from couchbase.options import ClusterOptions | |
from couchbase.auth import PasswordAuthenticator | |
import os | |
import string | |
from tqdm import tqdm |
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
#include <iostream> | |
#include <vector> | |
#include <random> | |
#include <algorithm> | |
#include <numeric> | |
#include <thread> | |
#include <mutex> | |
const int num_simulations = 10000; // Number of Monte Carlo simulations | |
const int num_days = 252; // Number of trading days in a year |
NewerOlder