This specialized module helps interns use Apple Silicon chips (the company currently has M4 and M5 Series), leveraging Unified Memory hardware and integrated GPU to accelerate graphics processing as well as AI training/inference.


Required knowledge to grasp


  • Apple Silicon hardware knowledge: Understand Unified Memory Architecture and the role of Neural Engine, GPU Core.

  • Deep Learning Library knowledge: Proficient in basic PyTorch (torch.nn, Tensor).

  • MPS concept: Understand how PyTorch uses the torch.device("mps") backend instead of Nvidia's torch.device("cuda") on macOS.


Implementation sequence


  1. Receive server information: Log in to the system https://dev.mdcgroup.vn, request remote account (SSH/VNC) access to the company's Mac Studio/Mac Mini cluster running Apple Silicon chips.

  2. Install Native environment: Install Conda package manager (Miniforge specifically for ARM64 architecture). Initialize Python environment and install the latest PyTorch version supporting native MPS.

  3. Check hardware via Code: Write a short Python script using the torch.backends.mps.is_available() command to verify that the system has successfully enabled Apple graphics chip acceleration.

  4. Perform Tensor computation conversion: Write code to create large matrices, perform processing device conversion (tensor.to("mps")), and compare the execution speed of matrix multiplication operations between pure CPU and MPS device.

  5. Train/Infer model experimentally: Take a sample Deep Learning model (such as ResNet or a simple CNN network). Proceed to run Train/Inference on the MPS device, monitor RAM usage, temperature, and power consumption via Activity Monitor or the CLI tool powermetrics.

  6. Compare optimization: Write a script to evaluate application runtime on the same workload between enabling MPS and disabling MPS (using only CPU).


Result acceptance


  • Multiple-choice test: Take a multiple-choice test on computer architecture and the MPS Framework on the internal website.

  • Questions & Suggestions: Provide feedback on the cost-effectiveness and energy consumption of the Apple Silicon cluster when running AI compared to clusters running traditional GPUs.

  • Report results: Send the performance comparison file (processing time chart) along with clean test source code to the manager.

  • Weekend discussion: Share experiences handling mathematical functions not fully supported by MPS at the Saturday discussion session.