.sh
  • 2022-03-09

    CPython Internals: IR Generation

    As mentioned in the previous post, there are multiple entrypoints to execute CPython. While these methods might have different strategy for converting the source code to the AST, they share the same entrypoint _PyAST_Compile defined in Python/compile.c to generate the control flow graph (CFG) and the bytecodes.


  • 2022-02-26

    Stein Variational Gradient Descent

    The main challenge of the modern Bayesian inferences is about how to handle the intractable posterior. In many models, especially in deep neural networks, the posterior distribution consists of billions of parameters in a highly nonlinear and complex relationships. Traditional algorithms such as Markov chain Monte Carlo (MCMC) and variational inference (VI) are usually not suitable; the former lacks scalability and the latter lacks expressive power.

    Stein variational gradient descent (SVGD), suggested by Liu & Wang, is a new algorithm for Bayesian models different from the MCMC and VI.


  • 2022-02-05

    CPython Internals: Frontend of Bytecode Compiler

    Typically, compilers consist of two parts: a frontend and a backend. This post will cover the frontend of CPython's bytecode compiler, or "how CPython understand the human-readable code?"


  • 2022-01-03

    CPython Internals: Optimization in Garbage Collection

    Without proper optimizations, the basic CPython garbage collector covered in previous post may result in quadratic time complexity. Two techniques are currently applied: using generations and untracking some objects during GC.


  • 2022-01-02

    CPython Internals: Garbage Collection Basics

    CPython manages the memory by using a garbage collector, where the garbage collector relies on the reference counting with a cycle detection algorithm.


1 2 --->
ascii kitten
© Seokjin Han 2022. All contents on this website is licensed under CC BY-SA 4.0.
Privacy Policy