Let's Talk About Hash Functions in Python: Lessons from vLLM's Chained Hashing Evolution

Lightning
Shanghai
2:50 p.m. - 3 p.m.
Venue E(Integrated Building, Room 108 Lecture Hall)
  • LuminolT Graduate student at SJTU, member of TAI

    I am a graduate student at the School of Computer Science, Shanghai Jiao Tong University, and a member of TAI. My research interests focus on large language model inference systems and confidential computing. I have worked on LLM inference infrastructure and have been actively involved in performance analysis and engineering optimization for inference frameworks such as vLLM and SGLang, covering areas including Prefix Cache, KV Cache, MoE inference, and serving optimization. As a vLLM contributor, I contributed to the implementation and upstream integration of xxHash-based Prefix Caching support.

    lumonoit

Abstract

Starting from the chained hashing design of vLLM Prefix Cache, this talk walks through the evolution from Python's built-in hash() to SHA-256 and xxHash, covering the trade-offs among performance, stability, and security.

Details

In Python services, hash functions are commonly used for dictionary indexing, cache keys, data partitioning, content deduplication, and many other tasks. However, Python's built-in hash(), xxHash, and cryptographic hash functions such as SHA-256 provide very different engineering properties. This talk starts from the chained hashing design of vLLM Prefix Cache and walks through the evolution from Python's built-in hash() to SHA-256, and later to the introduction of xxHash as an additional option. The talk also covers the practical trade-offs among performance, stability, and security, based on the implementation experience of adding xxHash support.