Mlir for Machine Learning Compilers: TENSORFLOW, PYTORCH, AND HARDWARE ACCELERATION: Optimize inference and training with dialect design, graph transf
暫譯: 機器學習編譯器的 MLIR:TENSORFLOW、PYTORCH 與硬體加速:透過方言設計、圖形轉換優化推論與訓練

Rao, Anik

  • 出版商: Independently Published
  • 出版日期: 2025-10-29
  • 售價: $1,670
  • 貴賓價: 9.5$1,586
  • 語言: 英文
  • 頁數: 252
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 9798272164148
  • ISBN-13: 9798272164148
  • 相關分類: TensorFlow
  • 海外代購書籍(需單獨結帳)

商品描述

Build production grade ML compilers with MLIR, from TensorFlow and PyTorch graphs to fast GPU, CPU, and embedded executables

Machine learning teams struggle to turn research models into efficient binaries across diverse hardware. Toolchains are fragmented, passes are opaque, and small changes can break performance or correctness.

This book gives you a clear path. You get a practical workflow that starts with readable IR, enforces graph invariants with strong verifiers, and lowers to portable or vendor specific code that you can ship with confidence.

  • Design solid operators using ODS and traits, add verifiers and builders that keep graphs legal, and attach interfaces that unlock tiling, fusion, and bufferization
  • Import TensorFlow with StableHLO and VHLO, use the TFLite and TF bridges, and keep portability with TOSA when you need framework neutral flows
  • Capture PyTorch programs with Torch MLIR, decompose to arith tensor and linalg, and manage distinct training and inference paths without forking pipelines
  • Apply shape reasoning with the Shape dialect, handle static and dynamic ranks, and wire in inference that feeds downstream transforms
  • Run post training quantization with the Quant dialect, carry scales and zero points correctly, and build calibration aware dequant pipelines
  • Bufferize tensors with One Shot Bufferize, control function boundaries, model effects precisely, and validate lifetimes with ownership based deallocation
  • Tune memory with MemRef layout maps, alignment and packing, and pick layouts that suit accelerators without losing legality
  • Generate GPU code with GPU and NVGPU dialects, target NVVM or ROCDL, and use vector and tensor core paths that map to real intrinsics
  • Target SPIR V for Vulkan environments with capability gating, or generate portable C and C++ for microcontrollers with EmitC
  • JIT with ExecutionEngine and JitRunner, or use IREE end to end for compilation and runtime on mobile, desktop, and server
  • Drive performance with tiling fusion and vectorization in Linalg and Vector, add autotuning hooks, and apply the Sparse Tensor dialect for structured sparsity
  • Profile with remarks counters and traces, then lock down stability with lit and FileCheck, mlir reduce, bytecode, and dialect versioning
  • Work through complete case studies, TensorFlow ResNet to CUDA with NVGPU and NVVM, PyTorch Transformer to ROCm with ROCDL, quantized MobileNet to EmitC for Cortex M, and sparse attention to SPIR V for Vulkan

This is a code heavy guide with labeled MLIR Python C++ Shell and TableGen listings, you can copy pipelines and schedules directly into your builds to stand up real projects.

Grab your copy today

商品描述(中文翻譯)

**建立生產級的機器學習編譯器,從 TensorFlow 和 PyTorch 圖形到快速的 GPU、CPU 和嵌入式可執行檔**

機器學習團隊在將研究模型轉換為高效的二進位檔時面臨挑戰,因為硬體多樣化導致工具鏈分散、過程不透明,且小的變更可能會影響性能或正確性。

本書為您提供了一條清晰的道路。您將獲得一個實用的工作流程,從可讀的中間表示(IR)開始,通過強大的驗證器強制執行圖形不變性,並降低為可攜式或特定供應商的代碼,讓您可以自信地發佈。

- 使用 ODS 和 traits 設計穩固的運算子,添加驗證器和建構器以保持圖形的合法性,並附加接口以解鎖切片、融合和緩衝區化
- 使用 StableHLO 和 VHLO 導入 TensorFlow,利用 TFLite 和 TF 橋接,並在需要框架中立流程時保持可攜性與 TOSA
- 使用 Torch MLIR 捕捉 PyTorch 程式,分解為算術張量和線性代數,並在不分叉管道的情況下管理不同的訓練和推論路徑
- 使用 Shape 方言應用形狀推理,處理靜態和動態秩,並接入推論以供下游轉換使用
- 使用 Quant 方言執行訓練後量化,正確處理比例和零點,並構建考慮校準的去量化管道
- 使用 One Shot Bufferize 對張量進行緩衝,控制函數邊界,精確建模效果,並通過基於所有權的釋放來驗證生命週期
- 使用 MemRef 佈局映射、對齊和打包來調整記憶體,選擇適合加速器的佈局而不失去合法性
- 使用 GPU 和 NVGPU 方言生成 GPU 代碼,針對 NVVM 或 ROCDL,並使用映射到實際內建函數的向量和張量核心路徑
- 針對 Vulkan 環境的 SPIR V 進行能力閘控,或使用 EmitC 為微控制器生成可攜式 C 和 C++
- 使用 ExecutionEngine 和 JitRunner 進行即時編譯,或使用 IREE 進行移動端、桌面和伺服器的端到端編譯和執行
- 通過 Linalg 和 Vector 中的切片融合和向量化來驅動性能,添加自動調整鉤子,並應用稀疏張量方言以實現結構稀疏性
- 使用備註計數器和追蹤進行性能分析,然後使用 lit 和 FileCheck、mlir reduce、位元碼和方言版本控制來鎖定穩定性
- 完成案例研究,從 TensorFlow ResNet 到使用 NVGPU 和 NVVM 的 CUDA,從 PyTorch Transformer 到使用 ROCDL 的 ROCm,從量化的 MobileNet 到 Cortex M 的 EmitC,以及從稀疏注意力到 Vulkan 的 SPIR V

這是一本以代碼為重點的指南,包含標記的 MLIR Python C++ Shell 和 TableGen 列表,您可以直接將管道和排程複製到您的構建中,以建立真實的專案。

**今天就來獲取您的副本**