Skip to content
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

Properly initialize ConvSolver by default. #2427

Open
CAHEK7 opened this issue Oct 2, 2023 · 6 comments
Open

Properly initialize ConvSolver by default. #2427

CAHEK7 opened this issue Oct 2, 2023 · 6 comments
Labels

Comments

@CAHEK7
Copy link
Contributor

CAHEK7 commented Oct 2, 2023

Based on #2379 (comment)

Currently ConvSolver initialized with miopenStatusSuccess by default, but it's not actually initialized with meaningful values:

    ConvSolution(miopenStatus_t status_ = miopenStatusSuccess)
        : status(status_),
          solver_id("<unknown>"),
          invoker_factory(boost::none),
          workspace_sz(0),
          grp_tile1(-1),
          grp_tile0(-1),
          in_tile1(-1),
          in_tile0(-1),
          out_pix_tile1(-1),
          out_pix_tile0(-1),
          n_out_pix_tiles(-1),
          n_in_data_tiles(-1),
          n_stacks(-1)
    {}

It's better to set the default status to miopenStatusNotInitialized, because otherwise empty solver may be used as a normal one and may trigger errors much later (or the other values will be checked to verify that it's a properly initialized solver, which make the status_ meaningless).

@atamazov what do you think?

@atamazov
Copy link
Contributor

atamazov commented Oct 2, 2023

@CAHEK7 Please remove https://github.com/ROCmSoftwarePlatform/MIOpen/labels/IMPACTS_API.

wrt initialization of status

  • at first glance your proposal is good
  • however AFAICS a Solver should either return a valid Solution or flag an error.
  • therefore inclusion of status into Solution seems to have been the wrong choice
  • the above is the reason of the bizarre initialization of status
  • but it works well

Therefore, if we are not going to change the structure of ConvSolution, then I would keep current initialization of status as is.

@CAHEK7 CAHEK7 removed the IMPACTS_API label Oct 3, 2023
@JehandadKhan
Copy link
Collaborator

@CAHEK7 If you agree with the comment above, please close the issue.

@CAHEK7
Copy link
Contributor Author

CAHEK7 commented Oct 17, 2023

We talked one more time (with @atamazov and @DrizztDoUrden) and decided to remove the status from ConvSolution entirely and either return correctly initialized structure or throw an exception.
But it's not a critical task right now.

@CAHEK7
Copy link
Contributor Author

CAHEK7 commented Oct 17, 2023

All of the CK, MLIR and GEMM based kernels do return {}; if CK\MLIR\GEMM disabled and must do return {miopenStatusNotInitialized}.

Current design is error-prone and must be fixed.

@ppanchad-amd
Copy link

@CAHEK7 Is this issue resolved? Thanks!

@CAHEK7
Copy link
Contributor Author

CAHEK7 commented Jun 12, 2024

@ppanchad-amd no. It is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants