@tqchen@preethireddy@shivmgg@echuraev
I am developing an iOS TVM application but Irrespective of input same inference output I am getting in the iOS TVM model.
Converted TensorFlow model to TVM model - success
Tried to inference converted x86 TVM model in python - success
Again converted TF model to TVM model of iOS ARM64 - success
Tried to inference converted arm64 model in iOS - Irrespective of input same output not giving expected inference output.
Below are the target and target_host:
target = ‘metal’
target_host = “llvm -mtriple=arm64-apple-darwin”
Note: If I set all input values to zero it is giving the same inference output.
What will be the issue kindly help me to fix this issue.
Tried to inference converted arm64 model in iOS - Irrespective of input same output not giving expected inference output.
Do you do this through RPC or build in TVM/model to your application? If you do natively and run your own app on iOS, how do you feed data? Could you share this part of code?
which context do you use for creation of m_gpuInput and how do you populate data?
BTW, you are loading params and json that means that you are using packed zip format for storing model. Is it more convinient for you? Does it find artefacts during the loading of model? I prefer to use everything been packed to one library created by lib.export_library
missing of *4 - is it a problem of copy-past or you forgot to compensate the size of the float? since TVMArrayCopyFromBytes deal with bytes, not floats.
Another question why do you need m_gpuInput? you can use only NDArray been allocated with CPU context. Copy will happen automatically inside the TVM runtime.
And my understanding is we can’t directly access GPU memory so i copied all my input data to CPU memory and then copied to GPU memory please excuse me if my understanding was wrong.
Copy from Metal to CPU
I.e. in your case one more extra copy will be done and it will be much easier currently just to pass NDArray working with CPU context.
Could you pass m_cpuInput to set_input("INPUT", m_cpuInput); and verify the result?
Another difference - I looked in my code and figured out that I have not used TVMArrayCopyFromTo, but used function of NDArray. Like
@myproject24 did you have a chance to verify if passing of CPU NDArray to input and using of the other API for copy data helps to solve the problem or not?