ROCm / composable_kernel

Composable Kernel: Performance Portable Programming Model for Machine Learning Tensor Operators
https://rocm.docs.amd.com/projects/composable_kernel/en/latest/
Other
299 stars 118 forks source link

[BUG]: when enable arg.print() got print errors #1438

Open ZJLi2013 opened 2 months ago

ZJLi2013 commented 2 months ago

Problem Description

to debug 02_gemm_add_add_fastgelu with client api, I tried to enable arg.Print() under Invoker:;Run() as following:

    // Invoker
    struct Invoker : public BaseInvoker
    {
        using Argument = DeviceOp::Argument;

        float Run(const Argument& arg, const StreamConfig& stream_config = StreamConfig{})
        {
            // Fix ME 
            arg.Print();
...

and the original Print()

while during building, these TensorDescriptor , a_grid_desc_mk, b_grid_desc_nk, ds_grid_desc_mn, e_grid_desc_mn doesn't support << operation, give building errrors.

as TensorDescriptor class has its own Print() , looks the following way works:

        void Print() const
        {
            std::cout << "{ \n" ;
                a_grid_desc_m_k_.Print() ;
                b_grid_desc_n_k_.Print(); 
                static_for<0, NumDTensor, 1>{}(
                [&](auto i) { ds_grid_desc_m_n_[i].Print(); });
                e_grid_desc_m_n_.Print();
            std::cout >> "} \n" ; 
        }

Thanks for clarifying this

David

Operating System

ubuntu 20.04

CPU

Ryzen

GPU

AMD Instinct MI300

Other

rocm 6.1.3

ROCm Version

ROCm 6.0.0

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

ZJLi2013 commented 2 months ago

related to https://github.com/ROCm/composable_kernel/issues/419 ?