Skip to content

Instantly share code, notes, and snippets.

View interestingLSY's full-sized avatar

Shengyu Liu interestingLSY

View GitHub Profile
@abcdabcd987
abcdabcd987 / 2025-02-23-mla-flashinfer-vs-deepseek.py
Last active May 4, 2025 07:50
MLA Kernel Performance: FlashInfer vs DeepSeek FlashMLA
# Results: https://docs.google.com/spreadsheets/d/1t0Txa7Ph9u7Su9LyWpS24vqr9A5FB-FyL0EZNpYOqwg/edit?gid=0#gid=0
# FlashInfer: 28053ac54023fbf3fb552f7be015b0f90a37ed76
# FlashMLA : accc1695ee0ff996ec63eaf2ebcbf6874ed0e7df
import itertools
import torch
from flash_mla import flash_mla_with_kvcache, get_mla_metadata
from flashinfer import BatchMLAPagedAttentionWrapper
from triton.testing import do_bench # type: ignore[import]
@l1997i
l1997i / Bug_report_on_CS_APP_labs.md
Last active July 29, 2022 01:45
Bug report on CS:APP labs

Bug Details

In rtarget Phase 3 of Attack Lab [Updated 1/11/16], which involving a code injection attack, if some of students want to use a return address containing 0x0a in their target injection codes, then getbuf() may parse 0x0a as newline which leads to termination of the injection codes behind. Since each students in CMU has their only attack targets which are built automatically, if some of the targets are built with address in gadgets farm they need containing 0x0a, it will unfortunately stop students from implementing injection attacks.

Steps to reproduce bug

  1. My injection attacks solution in asm code

movq %rsp, %rax

@zmts
zmts / docker.md
Last active May 19, 2024 14:47
Docker, TypeScript, Node.js

Docker, TypeScript, Node.js

Preconditions:

  • TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
@Ruanxingzhi
Ruanxingzhi / boom.py
Created May 18, 2017 11:49
炸hustoj
# ----------- 批量注册 -----------
from os import system
def reg(i):
system('wget --post-data="user_id=stress_test%d&password=stress_tester&rptpassword=stress_tester&nick=压力测试者" http://example.com/JudgeOnline/register.php -O ww'%i)
for i in range(1000):
reg(i)
# ----------- 批量提交 -----------
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 2, 2025 01:41
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@jboner
jboner / latency.txt
Last active June 2, 2025 03:01
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD