Skip to content

Instantly share code, notes, and snippets.

View day253's full-sized avatar

day253 day253

View GitHub Profile
@day253
day253 / microgpt-moe.py
Created March 10, 2026 15:42 — forked from busfahrer/microgpt-moe.py
MoE hack of microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; 作者: 李继刚
;; 日期: 2025-11-12
;; 剑名: 圆桌讨论
;; 剑意: 构建一个以“求真”为目标的结构化对话框架。该框架由一位极具洞察力的主持人
;; 进行引导,邀请代表不同思想的“典型代表人物”进行一场高强度的、即时响应式的
;; 深度对话。主持人将在每轮总结时生成视觉化的思考框架(ASCII Chart),通过
;; “主动质询” 与“协同共建”,对用户提出的议题进行协同探索,最终生成深刻的、
;; 结构化的知识网络。
@day253
day253 / microgpt.py
Created February 15, 2026 14:45 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@day253
day253 / nvidia-smi
Created January 6, 2025 03:21
nvidia-smi
nvidia-smi -h
NVIDIA System Management Interface -- v520.61.05
NVSMI provides monitoring information for Tesla and select Quadro devices.
The data is presented in either a plain text or an XML format, via stdout or a file.
NVSMI also provides several management operations for changing the device state.
Note that the functionality of NVSMI is exposed through the NVML C-based
library. See the NVIDIA developer website for more information about NVML.
Python wrappers to NVML are also available. The output of NVSMI is
@day253
day253 / example.py
Last active December 30, 2024 09:31
__vsc_ipynb_file__
import IPython
import os
notebook_file_path = IPython.extract_module_locals()[1]["__vsc_ipynb_file__"]
print(notebook_file_path)
dir_path = os.path.dirname(notebook_file_path)
print(dir_path)
@day253
day253 / settings.json
Last active June 15, 2025 08:04
vscode settings.json
{
"editor.acceptSuggestionOnEnter": "off",
"editor.fontFamily": "JetBrains Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.wordWrap": "on",
"explorer.confirmDragAndDrop": false,
"python.languageServer": "Pylance",
"workbench.activityBar.orientation": "vertical",
"workbench.colorTheme": "Default Light Modern",
"[python]": {
@day253
day253 / Dockerfile
Created December 26, 2024 03:39
kubeval-tools
# https://hub.docker.com/_/python
FROM python:3.11
# runtime dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
git \
; \
rm -rf /var/lib/apt/lists/*
@day253
day253 / .gitlab-ci.yml
Created December 26, 2024 03:36
how-to-install-a-rpm-package-and-its-dependencies-offline
stages:
- build
- pack
- upload
- release
variables:
ARTIFACTS_NAME: ${CI_PROJECT_NAME}.tar.gz
build:
@day253
day253 / wayland.sh
Created December 10, 2024 14:20
Configure integrated GPU for rendering and NVIDIA GPU for CUDA works in Ubuntu 24.04
sudo prime-select
> Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
sudo prime-select query
> on-demand
sudo prime-select intel
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void dfs(int target, vector<int>& groups, int current, int& result) {
if (current >= target || current == 0) {
return;