CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[PIR] Support TensorArray #58756
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
[PIR] Support TensorArray #58756
Conversation
… dev/support_tensor_array
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.
Great work!
// const phi::DDim& AllocatedDenseTensorArrayType::dims() const { | ||
// return storage()->dense_tensor_array_type_.dims(); | ||
// } |
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.
无用注释可以删掉
return storage()->dense_tensor_array_type_.data_layout(); | ||
} | ||
|
||
// const phi::LoD& AllocatedDenseTensorArrayType::lod() const { |
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.
同上
|
||
const pir::Type &dtype() const; | ||
|
||
// const phi::DDim &dims() const; |
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.
同上
|
||
const phi::DataLayout &data_layout() const; | ||
|
||
// const phi::LoD &lod() const; |
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.
同上
/// \brief Each derived TypeStorage must provide a HashValue method. | ||
/// | ||
static std::size_t HashValue(const ParamKey& key) { | ||
std::size_t hash_value = 791; |
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.
这里为何是791
// hash_value = | ||
// pir::hash_combine(hash_value, | ||
// std::hash<phi::LoD>()(std::get<3>(key))); |
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.
同上
/// \brief DenseTensorTypeStorage include five parameters: dtype, layout | ||
/// | ||
pir::Type dtype_; | ||
// phi::DDim dims_; |
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.
同上
pir::Type dtype_; | ||
// phi::DDim dims_; | ||
phi::DataLayout layout_; | ||
// phi::LoD lod_; |
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.
同上
} else if (paddle::dialect::IrMetaTensor::classof(tensor_)) { | ||
static_cast<paddle::dialect::IrMetaTensor*>(tensor_)->SetLod(lod); |
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.
对于独立依赖phi算子库的代码来说,这里会有编译问题,建议删掉
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.
单独提 pr 系统修复该问题
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "paddle/phi/kernels/tensor_array_kernel.h" |
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.
建议文件名字改成 array_kernel.h/.cc,与python端的文件名对应更容易理解
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.
done
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
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
* add tensor array type * add array length op * add array length api * add array length api * add array length api * add create array op * add create array api * add array wirte * fix * fix * add array wirte api * fix * fix * fix * fix * fix * fix * fix * add array read * add array read * fix * fix * add api * fix * add yt * support gpu * fix * refine * fix
PR types
New features
PR changes
Others
Description
PIR 体系支持 TensorArray 机制,具体扩展的功能及改造如下:
Pcard-67164