mllm icon indicating copy to clipboard operation
mllm copied to clipboard

printData and saveData error

Open zyf-gh opened this issue 10 months ago • 2 comments

When I execute outputs.printData<float>() or outputs.saveData<float>() on ouputs in the Forward function in the src/models/phonelm/modeling_phonelm.hpp/PhoneLMForCausalLM , a Segmentation fault occurs. How can I get the data of outputs ?

zyf-gh avatar Feb 28 '25 12:02 zyf-gh

The execution logic of mllm is reshape -> setup -> exec. During the reshape phase, the memory corresponding to the tensor has not been created yet, which may lead to errors. You can write some helper functions to obtain the raw pointer, and store the tensor only when the pointer is not null.

chenghuaWang avatar Feb 28 '25 12:02 chenghuaWang

Thank you! It is indeed caused by the null pointer.

zyf-gh avatar Feb 28 '25 13:02 zyf-gh