Skip to content

Donald Sebastian Leung

Infrastructure | Ops

Send me an email

  • About
  • Migrating to WordPress.com from Alibaba Cloud

    2026-07-25

    +

    +

    +

    +

    +

    +

    My personal website was born in 2015 when I took an introductory web development course by BSD Education. Since then, it has been re-architected multiple times over the past decade as my personal and professional interests evolved. The details can be found in my blog post Migrating my website to an event-driven serverless architecture from 2023.

    (more…)

    +

    +

    +

    +

    +

    +

    + Cloud, WordPress

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Uncovering a curious case of distribution shift

    2026-07-18

    +

    +

    +

    +

    +

    +

    The source code for the experiment mentioned in this article is available on GitHub.

    I was studying chapter 9 of D2L recently on natural language processing (NLP) using recurrent neural networks (RNN). To validate and further reinforce my understanding of the concepts presented in the chapter, I decided to train a word-level language model from scratch based on the King James Version (KJV) of the Christian Bible.

    (more…)

    +

    +

    +

    +

    +

    +

    + Ascend NPU, CANN, Deep learning, Jupyter, MindSpore, MLOps, Model training and evaluation, Python

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Building my AI homelab, part 1

    2026-06-28

    +

    +

    +

    +

    +

    +

    The source code for this article is available on GitHub.

    I recently purchased the GMKtec NucBox K11 Mini PC for building my AI homelab and support my ongoing journey on MLOps and deep learning. This blog post explains my motivations for building my AI homelab, the difficulties I encountered along the way, the design decisions I made to arrive at my current setup and my next steps once the OrangePi AI Studio Pro extension dock is available.

    A big thank you to my employer Enfinity Solutions for arranging the Mini PC purchase and making this all possible!

    NucBox K11 Mini PC
    (more…)

    +

    +

    +

    +

    +

    +

    + Deep learning, Git, GitOps, Jupyter, Kubernetes, MLOps, Python, PyTorch

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Bootstrapping a self-service AI platform with GitOps

    2026-06-19

    +

    +

    +

    +

    +

    +

    The source code for this article is available on: GitHub, GitCode.

    Kubeflow transforms Kubernetes into a self-service platform for AI practitioners and data scientists alike. It incorporates both established and emerging cloud and AI-native projects such as Istio, Envoy and Knative to support the entire MLOps lifecycle: data cleaning and preprocessing, model training, validation and serving etc. Originally developed by Google to run TensorFlow on Kubernetes, it is now a CNCF Incubating project.

    (more…)

    +

    +

    +

    +

    +

    +

    + Cloud, Deep learning, Git, GitOps, Jupyter, Kubernetes, MLOps, Python, PyTorch

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Tracking MindSpore experiments with MLflow

    2026-06-08

    +

    +

    +

    +

    +

    +

    The notebook source code for this experiment is available on GitHub.

    “MLflow is the largest open source AI engineering platform for agents, LLMs, and ML models.” It was originally developed by Databricks and joined the Linux Foundation in June 2020.

    MLflow enables data scientists and ML engineers to manage and visualize their model training pipelines through a unified platform. At the heart of MLflow are 2 key concepts.

    1. Experiment: a collection of model training pipelines useful for cross-evaluating the performance of different models and hyperparameters on the the same problem domain. For example, an experiment called fashion-mnist-linear compares the performance of training the same linear classifier with varying learning rates.
    2. Run: a single instance of a model training pipeline within an experiment. For example, our first run in fashion-mnist-linear trains a linear classifier with a learning rate of 0.01.
    (more…)

    +

    +

    +

    +

    +

    +

    + Ascend NPU, CANN, Deep learning, Jupyter, MindSpore, MLOps, Model training and evaluation, Python

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Fine-tuning ResNet-18 on CIFAR-100 with MindCV and MindSpore

    2026-05-23

    +

    +

    +

    +

    +

    +

    The notebook source code for this article is available on GitHub.

    Transfer learning is the practice of adapting a pre-trained model for a new but related task. An example of transfer learning is low-rank adaptation (LoRA), a common technique in LLM fine-tuning.

    In this notebook experiment, let’s load ResNet-18 with MindCV for fine-tuning on the CIFAR-100 dataset. ResNet-18 is a modern CNN pre-trained on ImageNet which makes it suitable for our task as both datasets represent image classification tasks. Furthermore, ImageNet contains far more samples and categories than CIFAR-100, meaning the pre-trained filters from ImageNet should translate well to CIFAR-100 with minor adjustments.

    (more…)

    +

    +

    +

    +

    +

    +

    + Ascend NPU, CANN, Deep learning, Jupyter, MindSpore, Model training and evaluation, Python

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Upgrading to MindSpore 2.9.0 + CANN 9.0.0 on the OrangePi AIpro (20T)

    2026-05-09

    +

    +

    +

    +

    +

    +

    The notebook source code for this article is available on GitHub.

    Last time we saw how to upgrade the MindSpore 2.4.10 + CANN 8.0.0 pre-included with the Ubuntu 22.04 desktop image for OrangePi AIpro (20T) to MindSpore 2.8.0 + CANN 8.5.0.

    MindSpore 2.9.0 + CANN 9.0.0 were released on May 2026 with the following major highlights, among others.

    1. Native support for Ascend 950PR inference-optimized NPUs which the DeepSeek-V4 series LLMs were optimized on
    2. Addition of 2 DeepSeek Sparse Attention (DSA) interfaces under mindspore.ops:
      1. mindspore.ops.sparse_flash_attention
      2. mindspore.ops.lightning_indexer

    This notebook article outlines the process of upgrading from MindSpore 2.8.0 + CANN 8.5.0 on the OrangePi AIpro (20T) development board to the latest MindSpore 2.9.0 + CANN 9.0.0 as of May 2026. We assume you have already replaced Conda from the provided Ubuntu 22.04 desktop image with pyenv for modern, efficient Python virtual environment management.

    (more…)

    +

    +

    +

    +

    +

    +

    + Ascend NPU, CANN, Jupyter, MindSpore, Python

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Migrating PyTorch deep learning workloads to the Ascend ecosystem

    2026-05-01

    +

    +

    +

    +

    +

    +

    The notebook source code for this article is available on GitHub.

    PyTorch is an open source deep learning framework in Python originally developed by Meta, now hosted under the vendor-neutral PyTorch Foundation. It is the de-facto industry standard for training modern deep learning models and large language models (LLMs). Like most other deep learning frameworks, PyTorch natively supports accelerating machine learning workloads on NVIDIA GPUs through its CUDA ecosystem without the need for special plugins or adapters.

    (more…)

    +

    +

    +

    +

    +

    +

    + Ascend NPU, CANN, Deep learning, Jupyter, Model training and evaluation, Python, PyTorch

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Accelerating model inference on NVIDIA Tesla T4 with ONNX Runtime

    2026-04-20

    +

    +

    +

    +

    +

    +

    This Kaggle Notebook is a GPU-enabled variation of my original notebook experiment.

    Open Neural Network Exchange (ONNX) is an open format built to represent machine learning models. It is used by popular deep learning frameworks such as MindSpore, PyTorch and TensorFlow to export machine learning models trained by these frameworks into the portable, unified and vendor-neutral ONNX format. This allows exported models to be loaded by any compatible framework or runtime for inference instead of being locked in to a single framework or provider.

    In this notebook experiment, we will load an ONNX model trained on the CIFAR-10 dataset mounted at /kaggle/input/models/donaldsebleung/cifar10-linear-simple/onnx/default/1/cifar10-linear-simple.onnx and serve it with ONNX Runtime for inference. ONNX Runtime is a cross-platform inference accelerator for ONNX models developed by Microsoft under the permissive MIT license.

    (more…)

    +

    +

    +

    +

    +

    +

    + Jupyter, Model Deployment and Inferencing, Python

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Serving machine learning models for inference with ONNX Runtime

    2026-04-19

    +

    +

    +

    +

    +

    +

    The notebook source code for this experiment is available on GitHub.

    Open Neural Network Exchange (ONNX) is an open format built to represent machine learning models. It is used by popular deep learning frameworks such as MindSpore, PyTorch and TensorFlow to export machine learning models trained by these frameworks into the portable, unified and vendor-neutral ONNX format. This allows exported models to be loaded by any compatible framework or runtime for inference instead of being locked in to a single framework or provider.

    In this notebook experiment, we will download an ONNX model trained on the CIFAR-10 dataset from Hugging Face and serve it with ONNX Runtime for inference. ONNX Runtime is a cross-platform inference accelerator for ONNX models developed by Microsoft under the permissive MIT license.

    (more…)

    +

    +

    +

    +

    +

    +

    + Jupyter, Model Deployment and Inferencing, Python

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

1 2 3 4
Next

GitHub

GITCODE

HUGGING FACE

MODELSCOPE

KAGGLE

Linkedin

Designed with WordPress.

Loading Comments...