[BugFix] Fixing binding for bert #18324
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR I was getting the following error:
Traceback (most recent call last): File "/home/thais/Dev/TVM-LLM-Bench/test-export.py", line 36, in <module> mod: tvm.IRModule = from_exported_program(exported_program) File "/home/thais/Dev/new-tvm/tvm/python/tvm/relax/frontend/torch/exported_program_translator.py", line 806, in from_exported_program return ExportedProgramImporter().from_exported_program( File "/home/thais/Dev/new-tvm/tvm/python/tvm/relax/frontend/torch/exported_program_translator.py", line 718, in from_exported_program binding[bind_name] = tvm.nd.from_dlpack(tensor_value.detach()) File "/home/thais/Dev/new-tvm/tvm/python/tvm/runtime/ndarray.py", line 66, in from_dlpack return tvm.ffi.from_dlpack( File "tvm/ffi/cython/./ndarray.pxi", line 112, in tvm.ffi.core.from_dlpack File "tvm/ffi/cython/./ndarray.pxi", line 60, in tvm.ffi.core._from_dlpack File "tvm/ffi/cython/./error.pxi", line 171, in tvm.ffi.core.CHECK_CALL File "tvm/ffi/cython/core.cpp", line 19568, in __pyx_pw_3tvm_3ffi_4core_35from_dlpack File "tvm/ffi/cython/core.cpp", line 19691, in __pyx_pf_3tvm_3ffi_4core_34from_dlpack File "tvm/ffi/cython/core.cpp", line 19179, in __pyx_f_3tvm_3ffi_4core__from_dlpack RuntimeError: FromDLPack: Data is not aligned to 64 bytes.