Kolen Cheung
  • Posts
  • About
Categories
All (9)
AI (1)
article (2)
HPC (4)
JAX (4)
physics (1)
QM (1)
reproducibility (1)
RSE (6)
slides (6)

Posts

Kolen Cheung

Kolen Cheung trained as a physicist — PhD from UC Berkeley, CMB cosmology, Bayesian inference at petabyte scale — but has always been more at home in mathematics. The…

Journal Club

slides
RSE
AI

Journal club discussion on agentic coding: the shift from autocomplete to autonomous agents (Claude Code, Codex CLI), vibe coding vs. agentic engineering, and the implications for software quality.

May 6th, 2026

Reproducibility in Computational Research

slides
RSE
reproducibility

Reproducibility is a cornerstone of computational research, yet achieving it across diverse computing environments remains challenging. This examines the landscape of software environment management tools and their role in enabling reproducible research workflows. We begin by clarifying the terminology around reproducibility, distinguishing between re-runnability, repeatability, reproducibility, reusability, and replicability. We then explore the multifaceted nature of package managers—as software tools, ecosystems, indices, and distributions—and categorize them by scope, distribution method, platform support, and linking strategy.

The core focus is on practical solutions to three critical problems: reproducing research software environments across different systems and platforms, customizing build processes while maintaining reproducibility (particularly for high-performance computing contexts), and distributing these environments effectively. We provide in-depth analysis of several key technologies: Conda/Mamba for cross-platform binary package management, (TODO: Pixi for modern Python project workflows with lock files and task automation, and brief overviews of Nix, Spack, and Docker). Through concrete examples ranging from pure Python packages to complex scientific software stacks and HPC system environments, we demonstrate how these tools address real-world reproducibility challenges. The presentation emphasizes the importance of understanding the ecosystem around package managers, including channels like conda-forge, and discusses advanced topics such as build customization, platform-specific optimizations, (TODO: and the trade-offs between source and binary distributions).

November 26th, 2025

JIT compilers for scientific computing in Python: Numba vs. JAX

slides
RSE
JAX
HPC

Accelerating scientific Python with JITs. We share our journey migrating a gravitational lensing likelihood calculation from Numba to JAX. Learn about performance gains, automatic differentiation benefits, and practical lessons for high-performance scientific computing in Python.

Python is widely used in scientific research, but pure Python can sometimes be too slow for computationally intensive tasks. Just-In-Time (JIT) compilers are essential tools for boosting performance, allowing Python code to run closer to native speeds. While libraries like Numba have long been popular for accelerating numerical Python functions, JAX offers a new paradigm, combining JIT compilation with powerful features like automatic differentiation (auto-diff) and execution across different hardware (CPUs, GPUs, TPUs).

This talk will take you on a journey through our experience optimizing a critical component of an astrophysics analysis pipeline: the calculation of the likelihood function for gravitational lensing models, used with data from the James Webb Space Telescope. We initially used Numba to accelerate this calculation, but the need for performance portability across hardwares, and the potential speed up from gradient computation for model fitting led us to explore JAX’s unique capabilities.

This session will walk through the practical steps, challenges, and insights gained from migrating this complex scientific code from its existing Numba implementation to a JAX-based one.

You will learn:

  • Why leveraging performance tools like JITs is crucial for cutting-edge scientific analysis in Python.
  • The practical considerations when migrating existing numerical code from Numba to JAX, including syntax changes and managing state.
  • How JAX’s auto-differentiation simplifies gradient calculations essential for scientific optimization and sampling tasks.
  • The significant performance improvements achieved in our specific gravitational lensing case study by using JAX’s compiled functions.
  • Broader lessons learned about structuring scientific Python projects to effectively use modern JIT compilers and harness capabilities like auto-diff.

We’ll conclude by comparing Numba and JAX in benchmark performance, developer ergonomics, and tradeoffs between the two, providing you with practical guidance for choosing the right tool for your scientific computing needs.

This case study offers a concrete example of how evolving Python libraries are enabling researchers to perform complex, high-performance computations directly within the Python ecosystem. Join us to see how tools like JAX are empowering scientific discoveries, one optimised function at a time.

This talk is suitable for intermediate Python programmers familiar with NumPy.

September 21st, 2025

Durham HPC Days 2025

slides
HPC

Conference recap of Durham HPC Days 2025, covering themes of GPU acceleration, AI/HPC convergence, benchmarking, and the RSE community.

June 7th, 2025

Scientific Computing with JAX

slides
RSE
JAX
HPC

JAX is a Python library that combines just-in-time (JIT) compilation with automatic differentiation, powered by XLA (Accelerated Linear Algebra compiler), to target multiple hardware architectures including CPU, GPU (NVIDIA, AMD, Intel, Apple), and Google TPU. While primarily designed for machine learning research, JAX presents compelling advantages for scientific computing in the HPC landscape.

As HPC increasingly depends on heterogeneous accelerators, JAX’s “write once, deploy anywhere” approach enables scientific libraries to efficiently utilize diverse computing resources. Python programmers familiar with array programming and other JIT solutions like Numba can transition to JAX with minimal code changes, allowing straightforward adoption. Additionally, automatic differentiation provides gradient calculations for optimization problems with minimal developer effort — automatically generating derivatives that would be prohibitively complex to implement manually, while enabling optimization algorithms to converge more rapidly with gradient information.

This presentation examines the adaptation of a likelihood function calculation from Numba to JAX in the context of gravitational lensing analysis of James Webb Space Telescope observations. The case study specifically addresses the convergence of AI/ML techniques with traditional scientific computing, highlighting performance gains, implementation challenges, and practical considerations when migrating existing scientific code to JAX’s programming model. We’ll discuss how JAX enables scalable processing across different HPC hardware resources while maintaining scientific accuracy and computational efficiency.

June 4th, 2025

Scientific Computing with JAX: A Case Study (Transcript)

article
RSE
JAX
HPC

AI transcribed companion to the Durham HPC Days 2025 talk: porting a gravitational lensing likelihood from Numba to JAX for JWST analysis.

June 4th, 2025

Quantum Mechanics references

article
physics
QM

Annotated bibliography of quantum mechanics textbooks and lecture notes, with recommendations for different starting points and learning goals.

April 11th, 2025

DiRAC: revealing the nature of dark matter with the James Webb space telescope and JAX

slides
RSE
JAX

Introduction to adopting JAX for scientific computing, with a case study porting a gravitational lensing likelihood from Numba to JAX for JWST data analysis.

March 26th, 2025
No matching items

© Kolen Cheung