This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NFC: For TFPartition pass, enhanced debugging prints, by annotating S…
…IL code with marking enums, and also printing internal states like tensor start and end points, and the result tensors. This helps with understanding and debugging the TFPartition pass. Example output: ---- ANALYSIS STATE FOR FUNCTION $S19partition_study_tmp26testPartition1StraightlineyyF ---------- Tensor start point: %0 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %1 Tensor end point: strong_retain %9 : $TensorHandle<Float> // id: %10 SIL with markings: bb0: [Move] %0 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %1 [Move] %1 = builtin "__tfop_tfc.scalarToTensor,$in"(%0 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %14, %13, %6, %9, %5, %3, %15, %12, %9, %8, %7, %4, %2 strong_retain %1 : $TensorHandle<Float> // id: %2 strong_retain %1 : $TensorHandle<Float> // id: %3 strong_retain %1 : $TensorHandle<Float> // id: %4 strong_retain %1 : $TensorHandle<Float> // id: %5 strong_retain %1 : $TensorHandle<Float> // id: %6 strong_retain %1 : $TensorHandle<Float> // id: %7 strong_release %1 : $TensorHandle<Float> // id: %8 [Move] %9 = builtin "__tfop_Add,$in,$in"(%1 : $TensorHandle<Float>, %1 : $TensorHandle<Float>) : $TensorHandle<Float> // users: %46, %41, %31, %33, %30, %29, %16, %11, %10 strong_retain %9 : $TensorHandle<Float> // id: %10 strong_release %9 : $TensorHandle<Float> // id: %11 strong_release %1 : $TensorHandle<Float> // id: %12 strong_release %1 : $TensorHandle<Float> // id: %13 strong_release %1 : $TensorHandle<Float> // id: %14 strong_release %1 : $TensorHandle<Float> // id: %15 strong_retain %9 : $TensorHandle<Float> // id: %16 // function_ref implicit closure #1 in Tensor.array.getter %17 = function_ref @$S10TensorFlow0A0V5arrayAA11ShapedArrayVyxGvgSSyXKfu_ : $@convention(thin) () -> @owned String // user: %18 <ommited some code> ---- END OF ANALYSIS STATE FOR FUNCTION ---------- ---- PARTITION STATE FOR FUNCTION $S19partition_study_tmp26testPartition1StraightlineyyF ---------- (Possibly updated) tensor end point: strong_retain %9 : $TensorHandle<Float> // id: %10 There are 1 result values: %9 = builtin "__tfop_Add,$in,$in"(%1 : $TensorHandle<Float>, %1 : $TensorHandle<Float>) : $TensorHandle<Float> // users: %46, %41, %31, %33, %30, %29, %16, %11, %10 ---- END OF PARTITION STATE FOR FUNCTION ---------- PiperOrigin-RevId: 195049251
- Loading branch information