Re-engineering for better results: The Huawei AI stack
Huawei has launched its CloudMatrix 384 AI chip cluster, a brand new system for AI studying. It employs clusters of Ascend 910C processors, joined by way of optical hyperlinks. The distributed structure means the system can outperform conventional {hardware} GPU setups, significantly when it comes to useful resource use and on-chip time, regardless of the person Ascend chips being much less highly effective than these of opponents.
Huawei’s new framework positions the tech big as a “formidable challenger to Nvidia’s market-leading place, regardless of ongoing US sanctions,” the corporate claims.
To use the brand new Huawei framework for AI, knowledge engineers might want to adapt their workflows, utilizing frameworks that assist Huawei’s Ascend processors, such MindSpore, which can be found from Huawei and its companions
Framework transition: From PyTorch/TensorFlow to MindSpore
Unlike NVIDIA’S ecosystem, which predominantly makes use of frameworks like PyTorch and TensorFlow (engineered to take full benefit of CUDA), Huawei’s Ascend processors carry out finest when used with MindSpore, a deep studying framework developed by the corporate.
If knowledge engineers have already got fashions in-built PyTorch or TensorFlow, they are going to possible must convert models to the MindSpore format or retrain them using the MindSpore API.
It is price noting that MindSpore uses different syntax, training pipelines and function calls from PyTorch or TensorFlow, so a level of re-engineering will probably be essential to duplicate the outcomes from mannequin architectures and coaching pipelines. For occasion, particular person operator behaviour varies, corresponding to padding modes in convolution and pooling layers. There are additionally variations in default weight initialisation strategies.
Using MindIR for mannequin deployment
MindSpore employs MindIR (MindSpore Intermediate Representation), a detailed analogue to Nvidia NIM. According to MindSpore’s official documentation, as soon as a mannequin has been skilled in MindSpore, it may be exported utilizing the mindspore.export utility, which converts the skilled community into the MindIR format.
Detailed by DeepWiki’s information, deploying a mannequin for inference sometimes includes loading the exported MindIR mannequin after which working predictions utilizing MindSpore’s inference APIs for Ascend chips, which deal with mannequin de-serialisation, allocation, and execution.
MindSpore separates coaching and inference logic extra explicitly than PyTorch or TensorFlow. Therefore, all preprocessing must match coaching inputs, and static graph execution should be optimised. MindSpore Lite or Ascend Model Zoo are beneficial for further hardware-specific tuning.
Adapting to CANN (Compute Architecture for Neural Networks)
Huawei’s CANN features a set of tools and libraries tailored for Ascend software, paralleling NVIDIA’s CUDA in performance. Huawei recommends utilizing CANN’s profiling and debugging instruments to watch and enhance mannequin efficiency on Ascend {hardware}.
Execution Modes: GRAPH_MODE vs.PYNATIVE_MODE
MindSpore offers two execution modes:
- GRAPH_MODE – Compiles the computation graph earlier than execution. This may end up in quicker execution and better efficiency optimisation for the reason that graph may be analysed throughout compilation.
- PYNATIVE_MODE – Immediately executes operations, leading to easier debugging processes, better suited, due to this fact, for the early phases of mannequin growth, resulting from its extra granular error monitoring.
For preliminary growth, PYNATIVE_MODE is beneficial for easier iterative testing and debugging. When fashions are able to be deployed, switching to GRAPH_MODE might help obtain most effectivity on Ascend {hardware}. Switching between modes lets engineering groups stability growth flexibility with deployment efficiency.
Code needs to be adjusted for every mode. For occasion, when in GRAPH_MODE, it’s finest to keep away from Python-native management circulation the place attainable.
Deployment setting: Huawei ModelArts
As you would possibly count on, Huawei’s ModelArts, the corporate’s cloud-based AI growth and deployment platform, is tightly built-in with Huawei’s Ascend {hardware} and the MindSpore framework. While it’s similar to platforms like AWS SageMaker and Google Vertex AI, it’s optimised for Huawei’s AI processors.
Huawei says ModelArts helps the complete pipeline from knowledge labelling and preprocessing to mannequin coaching, deployment, and monitoring. Each stage of the pipeline is offered by way of API or the net interface.
In abstract
Adapting to MindSpore and CANN could necessitate coaching and time, significantly for groups accustomed to NVIDIA’s ecosystem, with knowledge engineers needing to know numerous new processes. These embrace how CANN handles mannequin compilation and optimisation for Ascend {hardware}, adjusting tooling and automation pipelines designed initially for NVIDIA GPUs, and studying new APIs and workflows particular to MindSpore.
Although Huawei’s instruments are evolving, they lack the maturity, stability, and broader ecosystem assist that frameworks like PyTorch with CUDA provide. However, Huawei hopes that migrating to its processes and infrastructure will repay when it comes to outcomes, and let organisations cut back reliance on US-based Nvidia.
Huawei’s Ascend processors could also be highly effective and designed for AI workloads, however they’ve solely restricted distribution in some nations. Teams outdoors Huawei’s core markets could wrestle to check or deploy fashions on Ascend {hardware}, until they use companion platforms, like ModelArts, that supply distant entry.
Fortunately, Huawei offers intensive migration guides, assist, and sources to assist any transition.
(Image supply: “Huawei P9” by 405 Mi16 is licensed beneath CC BY-NC-ND 2.0.)

Want to study extra about AI and massive knowledge from business leaders? Check out AI & Big Data Expo happening in Amsterdam, California, and London. The complete occasion is a part of TechEx and co-located with different main know-how occasions. Click here for extra info.
AI News is powered by TechForge Media. Explore different upcoming enterprise know-how occasions and webinars here.
The submit Re-engineering for better results: The Huawei AI stack appeared first on AI News.
