About lowering of tptr dialect #323
|
I have found that in some cases, unprocessed tptr dialects will be generated, such as some cases in Nhat Nguyen (@nhat-nguyen) ‘s repo triton-scratchpad.
|
Replies: 3 comments
|
And the _ttsharedir_to_llir would be like : pm = ir.pass_manager(mod.context)
pm.enable_debug()
triton_shared.to_llir.add_convert_linalg_to_affine_loops(pm)
triton_shared.to_llir.add_empty_tensor_to_alloc_tensor(pm)
triton_shared.to_llir.add_one_shot_bufferize_with_options(
pm, allow_return_allocs_from_loops=True)
triton_shared.to_llir.add_lower_affine(pm)
triton_shared.to_llir.add_convert_linalg_to_loops(pm)
triton_shared.to_llir.add_expand_strided_metadata(pm)
triton_shared.to_llir.add_convert_scf_to_cf(pm)
triton_shared.to_llir.add_convert_arith_to_llvm(pm)
triton_shared.to_llir.add_convert_math_to_llvm(pm)
triton_shared.to_llir.add_convert_complex_to_llvm(pm)
triton_shared.to_llir.add_convert_vector_to_llvm(pm)
triton_shared.to_llir.add_convert_index_to_llvm(pm)
triton_shared.to_llir.add_memref_expand(pm)
triton_shared.to_llir.add_finalize_memref_to_llvm(pm)
triton_shared.to_llir.add_convert_func_to_llvm(pm)
# ! convert here
# triton_shared.debug.enable_mlir_debug("tptr-to-llvm")
triton_shared.to_llir.add_convert_tptr_to_llvm(pm)
triton_shared.to_llir.add_convert_cf_to_llvm(pm)
triton_shared.to_llir.add_lower_affine(pm)
triton_shared.to_llir.add_convert_arith_to_llvm(pm)
triton_shared.to_llir.add_reconcile_unrealized_casts(pm)
pm.run(mod)
Path(llmlir_path).write_text(str(mod)) |
|
Sincerely hope to have suggestions from you Nhat Nguyen (@nhat-nguyen) |
|
Completely getting rid of tptr will not be possible until ptr has all the necessary features. Some of the ptr features are now available so we could start trimming some of tptr but not all. The PR you have to add tptr-to-llvm is a good stop gap for the CPU backend until ptr dialect has everything. |
Completely getting rid of tptr will not be possible until ptr has all the necessary features. Some of the ptr features are now available so we could start trimming some of tptr but not all. The PR you have to add tptr-to-llvm is a good stop gap for the CPU backend until ptr dialect has everything.