-
Notifications
You must be signed in to change notification settings - Fork 363
Fix roberta conversion bugs #964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@Njuapp Can you sign your commits? |
core/util/trt_util.cpp
Outdated
@@ -238,6 +238,7 @@ const std::unordered_map<at::ScalarType, nvinfer1::DataType>& get_at_trt_type_ma | |||
{at::kFloat, nvinfer1::DataType::kFLOAT}, | |||
{at::kHalf, nvinfer1::DataType::kHALF}, | |||
{at::kInt, nvinfer1::DataType::kINT32}, | |||
{at::kLong, nvinfer1::DataType::kINT32}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont want to just associate all instances of long with kINT32. If there are cases of kLong we should explicity handle these cases and explain what we want to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in this case in the evaluator, we can add a code path for Long in the to evaluator (when truncate is enabled) and print a warning
eb69bf2
to
4153778
Compare
Signed-off-by: Cheng Hang <[email protected]>
I have done cpp_lint with clang-format-9, but it still fails in CI/CD as above. I don't understand the reasons. Maybe you can help check cpp_lint too. |
I can fix the linting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Fix bugs encountered when converting a RoBERTa model.
Fixes #963
Specifically, it fixes three things:
aten::ne.Scalar(Tensor self, Scalar other) -> (Tensor)
, the datatype of Scalar is by default initialized to be of type float. This should be int32 in this case.aten::cumsum(Tensor self, int dim, *, int? dtype=None) -> (Tensor)
, the zeroValue which stores runningSum, is by default initialized to be of type float. This should be int32 in this case.aten::to.dtype(Tensor self, int dtype, bool non_blocking=False, bool copy=False, int? memory_format=None) -> (Tensor)
, it could be casting tensor tolong
datatype, but this cannot be processed in our code. We simply add an entry inget_at_trt_type_map
, whereat::kLong
would be mapped tonvinfer1::DataType::kINT32
since tensorRT could not supportlong
.Type of change
Please delete options that are not relevant and/or add your own.
Checklist: