1. 19 Oct, 2022 2 commits
  2. 13 Oct, 2022 1 commit
  3. 03 Oct, 2022 1 commit
    • Umang Yadav's avatar
      Add output_alias and runs_on_offload_target flags for the custom ops (#1309) · c9ffb38d
      Umang Yadav authored
      Adds two methods for the custom_ops virtual class.
      
      bool runs_on_offload_target(), if the custom op runs directly on the gpu then it should be set to true. in this case, custom op expects its parameters to reside in GPU memory and writes output to the GPU memory. If it is set to false then, custom op expects it's parameter to reside on the host and puts back the result into the host memory.
      
      output_alias, if output of the custom op is aliasing the input buffer. i.e. interpreting the same input buffer with differnet shape and strides.
      
      Update as_vector() in C++ API to handle non-standard shapes. It required exposing element_index to space_index conversion method for the shape class.
      c9ffb38d
  4. 28 Sep, 2022 1 commit
    • Umang Yadav's avatar
      Add compute_fp32 flag for quant_gemm tests (#1360) · 70e63960
      Umang Yadav authored
      test_gpu_pack_int8_args fails on gfx908 machine, because it doesn't set compute_fp32 flag correctly. This PR fixes the test such that it checks for the device-name, and rocblas-versions and sets this flag accordingly.
      70e63960
  5. 23 Sep, 2022 1 commit
  6. 14 Sep, 2022 1 commit
  7. 08 Sep, 2022 1 commit
  8. 06 Sep, 2022 1 commit
  9. 06 Jul, 2022 1 commit
    • Paul Fultz II's avatar
      Verify load and save (#1265) · f2531606
      Paul Fultz II authored
      *In the verification tests, check that saving and reloading the program is the same program. This also fixes serialization to always load instructions in the same order. There is also fixes for deconv and quant_conv which didn't save the solution id, and was broken for serialization.
      f2531606
  10. 05 Jul, 2022 1 commit
  11. 22 Jun, 2022 1 commit
  12. 17 Jun, 2022 2 commits
    • Umang Yadav's avatar
      Update lowering of Dot operator (#1247) · c99be32c
      Umang Yadav authored
      
      
      * remove code for allocation of C param in dot lowering
      
      * formatting
      Co-authored-by: default avatarPaul Fultz II <pfultz2@yahoo.com>
      c99be32c
    • kahmed10's avatar
      Create allocate op and replace_allocate pass (#1183) · add6fb3b
      kahmed10 authored
      
      
      * add allocate op header
      
      * formatting
      
      * add replace_allocate pass
      
      * formatting
      
      * move output param to remove_allocate pass
      
      * formatting
      
      * fix bugs in replace_allocate pass
      
      * formatting
      
      * fix verify if tests
      
      * formatting
      
      * move if op logic
      
      * formatting
      
      * cleanup lowering
      
      * cleanup lowering
      
      * formatting
      
      * fix tidy
      
      * formatting
      
      * fix tidy
      
      * add cpu allocate check
      
      * formatting
      
      * change cpu allocate in pass
      
      * formatting
      
      * add some tests for replace_allocate pass
      
      * formatting
      
      * pass by ref
      
      * fix run_pass
      
      * formatting
      
      * update variable name for module
      
      * update dce to use contains() and fix tidy
      
      * formatting
      
      * update cppcheck
      
      * add if test
      
      * formatting
      
      * add if test
      
      * rename var to mod_output_names
      
      * formatting
      
      * remove conditional
      
      * update allocate op and tests
      
      * formatting
      
      * update replace_allocate tests
      
      * update create_output_names() and conditional in replace_allocate
      
      * formatting
      
      * remove extra variable in replace_allocate
      
      * update tools script for allocation_model
      Co-authored-by: default avatarUmang Yadav <29876643+umangyadav@users.noreply.github.com>
      Co-authored-by: default avatarChris Austen <causten@users.noreply.github.com>
      Co-authored-by: default avatarPaul Fultz II <pfultz2@yahoo.com>
      add6fb3b
  13. 07 Jun, 2022 1 commit
  14. 17 Apr, 2022 1 commit
    • Paul Fultz II's avatar
      Reduce with runtime compilation (#1150) · f9a5b81e
      Paul Fultz II authored
      There is significant improvement on larger tensors with half almost 50% faster:
      
      lens: [1024, 384, 768]
      gpu::code_object[code_object=13832,symbol_name=kernel,global=39321600,local=256,]: 1.16685ms
      gpu::reduce_sum[axes={2}]: 1.73126ms
      Also for non-trivial layouts this can sometimes be over 2x faster:
      
      lens: [64, 1024, 768, 4]
      gpu::code_object[code_object=13832,symbol_name=kernel,global=39321600,local=256,]: 1.1706ms
      gpu::reduce_sum[axes={1}]: 2.63375ms
      Of course if the stride becomes larger this speed improvement diminishes due to poor memory access patterns. A lane_reduce instead of a block_reduce is needed for such type of kernels. I plan to address that in a future PR.
      
      Finally, this also includes a MIGRAPHX_GPU_DUMP_ASM env variable which will print out the assembly when the kernel compiles.
      f9a5b81e
  15. 11 Apr, 2022 1 commit
    • bpickrel's avatar
      scatter operator refactoring to include reduction (#1124) · 701c2014
      bpickrel authored
      Change the "scatter" struct and op to a base/child set of three: scatter_none, scatter_add, scatter_mul to mirror Onnx' ScatterElements op. and its three reduction options. (Onnx Scatter op is deprecated and is equivalent to scatter_none.)
      
      Provides both a reference op. and update to Onnx parsing. Tests updated and new test case added.
      701c2014
  16. 29 Mar, 2022 1 commit
    • Paul Fultz II's avatar
      Refactor runtime compiled kernels to use the same compile_ops pipeline (#1125) · 661046c6
      Paul Fultz II authored
      This adds the infrastructure so we can compile everything in parallel, whereas before only pointwise kernels were compiled in parallel. This will also directly integrate with lowering and the gpu-driver. The kernels for pointwise and roialign are using this infrastructure. Scatternd is not since it does require standard shape.
      
      This also makes it easier to add new runtime compiled kernels in the future.
      661046c6
  17. 03 Mar, 2022 2 commits
  18. 02 Mar, 2022 1 commit
  19. 11 Nov, 2021 1 commit
    • Paul Fultz II's avatar
      Conditionally enable pointwise fusion (#992) · 157935ff
      Paul Fultz II authored
      This enables the pointwise fusions using the MIGRAPHX_ENABLE_POINTWISE_FUSION env variable. Its disabled by default since MIOpen fusions need to be refactored.
      
      This also adds a compile_ops pass to compile the pointwise modules. All tests except test_gpu_fast_math passes with MIGRAPHX_ENABLE_POINTWISE_FUSION=1 set.
      157935ff
  20. 28 Oct, 2021 2 commits
  21. 20 Oct, 2021 1 commit
    • Shucai Xiao's avatar
      Roialign (#952) · d7653732
      Shucai Xiao authored
      Implementation of the roialign operator. For now, we have only the ref implementation. When we run a model on the GPU, we fall back the execution to use the ref implementation.
      d7653732
  22. 08 Oct, 2021 2 commits
  23. 01 Oct, 2021 1 commit
    • turneram's avatar
      Add multinomial op (#954) · 0b7672d7
      turneram authored
      
      
      Add multinomial op to onnx parser with ref and GPU implementations.
      
      The onnx parser inserts a literal of shape {batch_size, sample_size} with random values in the range [0, 1) and inserts existing ops to compute the cumulative density function. The multinomial operator multiplies the random values by the sum of the CDF and returns the index of the first element of the CDF that is greater than the result, representing samples randomly drawn from [0, class_size) that follow the log-probability distribution.
      
      Resolves #821
      Co-authored-by: default avatarShucai Xiao <shucai@gmail.com>
      0b7672d7
  24. 17 Sep, 2021 2 commits
    • Paul Fultz II's avatar
      985f58b0
    • Umang Yadav's avatar
      Remove alpha and beta attributes from dot operator (#945) · 9e43cb8b
      Umang Yadav authored
      This PR aims to remove alpha and beta attributes from dot operator completely.
      
      Previously dot operator was defined as C = alpha * A . B + beta * C where * is scalar multiplication and . is dot product or matrix multiplication depending on dimension of the inputs.
      
      Aim is to have the definition of dot operator as C = A . B without having alpha or beta.
      
      In order to achieve the same effect as alpha and beta (1) it multiplies the one of the inputs to the dot operator with alpha value. (2) if beta is present then, multiplies the C with beta and then adds into the output from step 1.
      9e43cb8b
  25. 16 Sep, 2021 1 commit
    • Shucai Xiao's avatar
      Loop operator (#853) · a275f590
      Shucai Xiao authored
      
      
      Add Loop operator for opset version 13.
      Notes: 1) Default max iteration number is 10 if no max iteration number is provided
      2) To change the max iter number, a user can set the max_loop_iterations in the onnx_option struct when parsing a model.
      3) The returned shape of the scan output is from the max_loop_iterations even the actual loop num is less than that. This issue also applies to other operators like NonZero and NonMaxSuppression. A issue #948 is created to track this and to be resolved later.
      Co-authored-by: default avatarPaul <pfultz2@yahoo.com>
      Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
      a275f590
  26. 02 Sep, 2021 2 commits
  27. 31 Aug, 2021 1 commit
    • Shucai Xiao's avatar
      Fix debug assert (#930) · bd85a76c
      Shucai Xiao authored
      * fix two asserts for debug build
      
      * add unit test for copy parameters
      
      * clang format
      
      * add a unit test for reorder_dims
      
      * change tranpose to always require perm not be empty
      
      * clang format
      
      * remove an unnecessary line
      
      * fix tidy error
      
      * fix review comments
      bd85a76c
  28. 08 Jul, 2021 1 commit
  29. 25 Jun, 2021 1 commit
  30. 15 Jun, 2021 1 commit
    • Shucai Xiao's avatar
      Int8 gemm support (#811) · 39bc6161
      Shucai Xiao authored
      
      
      * add a flag to indicate int8x4 input format
      
      * clang format
      
      * code backup
      
      * clang format
      
      * code backup
      
      * clang format
      
      * code backup
      
      * clang format
      
      * code backup
      
      * clang format
      
      * code backup
      
      * clang format
      
      * remove log info
      
      * remove unnecessary changes
      
      * fix cppcheck error
      
      * add unit tests to have more code coverage
      
      * clang format
      
      * add debug info
      
      * remove log info
      
      * fix cppcheck error
      
      * clang format
      
      * clang format
      
      * add one more unit tests for more scenarios
      
      * fix cppcheck error
      
      * clang format
      
      * fix review comments
      
      * clang format
      
      * rename p to m
      
      * fix review comments
      
      * refine unit tests
      
      * clang format
      
      * refine unit tests and fixed a bug
      
      * clang format
      
      * fix build error related to rocm4.2
      
      * fix a bug related to alpha and beta
      
      * refine two unit tests related to int8_gemm
      
      * fix cppcheck error
      
      * refine unit test to pass on mi100
      
      * add unit test for packing int8 args
      
      * clang format
      
      * change unit tests back
      
      * disable some unit tests for gpu
      
      * clang format
      
      * refine unit tests to run on mi100
      
      * clang format
      
      * refine unit tests
      
      * refine unit tests
      
      * clang format
      
      * change back a unit test
      Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
      39bc6161
  31. 08 Jun, 2021 1 commit
    • Cagri Eryilmaz's avatar
      Reverse Op (#846) · 9c54fc4f
      Cagri Eryilmaz authored
      
      
      * init reverseOp branch: ref op + ref test. WIP
      
      * first passing basic test
      
      * cleanup
      
      * additional axis implementation
      
      * additional test
      
      * ref op implementation vec to int for axis
      
      * ref op test change for axis
      
      * initial gpu files and test
      
      * updates to implementation and test
      
      * fixed some issues
      
      * clang format
      
      * cleanup
      
      * formatting
      
      * removing comments
      
      * remove local size, back to default
      
      * update tests: replace with std functions
      
      * multiple axis for reverse op
      
      * fix a build error
      
      * clang format
      
      * more tests
      
      * fix a bug for the reverse device function
      
      * clang format
      
      * fix a bug
      
      * clang format
      
      * ref test updates, multiaxis
      
      * formatting
      Co-authored-by: default avatarShucai Xiao <Shucai.Xiao@amd.com>
      Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
      9c54fc4f
  32. 06 May, 2021 1 commit
  33. 05 Apr, 2021 1 commit
    • Shucai Xiao's avatar
      Module build exec (#765) · 41c0487b
      Shucai Xiao authored
      
      
      * code cleanup
      
      * clang format
      
      * backup code
      
      * clang format
      
      * remove unnecessary code
      
      * clang format
      
      * add module print function
      
      * code backup
      
      * refine the module::print function
      
      * refine the module:to_value() function
      
      * code backup
      
      * backup code changes
      
      * code backup
      
      * remove to_value and from_value function from the module class
      
      * rename a function
      
      * rename the if operator
      
      * refine the if operator
      
      * refine the print function of module and program
      
      * code backup
      
      * code backup
      
      * fix a build warning
      
      * fix overload of compute_shape function
      
      * code backup
      
      * fix unit test error
      
      * fix cppcheck error
      
      * fix the issue related to the overload of compute_shape
      
      * fix review comments
      
      * fix cppcheck error
      
      * change the return name of if_op to be if
      
      * clang format
      
      * fix two unit tests
      
      * clang format
      
      * rename variables
      
      * clang format
      
      * remove the unused compute_op function
      
      * clang format
      
      * add lowering of if operator and compute_op function
      
      * clang format
      
      * add parsing if operator in onnx file
      
      * clang format
      
      * fix clang tidy format
      
      * clang format
      
      * add the gpu implementation of the if operator
      
      * enhance the validate function and uncomment a unit test
      
      * clang format
      
      * remove unnecessary code
      
      * add sub_module processing in ref passes
      
      * clang format
      
      * clang format
      
      * fix a hang issue related to the valid function
      
      * fix an issue in replace_refs
      
      * clang format
      
      * fix review comments
      
      * clang format
      
      * fix cppcheck error
      
      * clang format
      
      * add a unit test for more code coverage
      
      * clang format
      
      * fix review comments and add test for more code coverage
      
      * clang format
      
      * fix cppcheck error
      
      * clang format
      
      * fix cppcheck error
      
      * fix a cppcheck error
      
      * clang format
      
      * backup code
      
      * clang format
      
      * fix cppcheck error
      
      * clang format
      
      * some code refinement
      
      * clang format
      
      * code backup to handle submodules in module compilation
      
      * clang format
      
      * code backup
      
      * clang format
      
      * code backup
      
      * clang format
      
      * fix a bug related to literal id
      
      * fix a bug in gpu execution
      
      * change the way of compiling a graph
      
      * clang format
      
      * backup more changes
      
      * clang format
      
      * refine pass log information
      
      * remove unnecessary code
      
      * clang format
      
      * temp changes backup
      
      * clang format
      
      * add module name prefix to scratch memory id in hip_memory_allocation
      
      * clang format
      
      * change to copy the cond input by inserting a copy instruction
      
      * clang format
      
      * change to use the if output argument as the submodule output so can remove a gpu_copy
      
      * clang format
      
      * consider submodule in some compile passes
      
      * clang format
      
      * fix review comments
      
      * clang format
      
      * fix issues related to scratch memory
      
      * clang format
      
      * remove unnecessary code
      
      * fix cppcheck error
      
      * clang format
      
      * reslove the implicit dependencies issue related to submodule
      
      * clang format
      
      * fix cppcheck error
      
      * clang format
      
      * backup temp changes
      
      * clang format
      
      * fixed an bug in the has_instruction function
      
      * clang format
      
      * fix the return value of the gpu implementation of the if operator
      
      * fix a bug in the compute_shape function in the gpu implementation
      
      * add an if onnx unit test
      
      * clang format
      
      * add more unit tests
      
      * clang format
      
      * tmp code backup
      
      * clang format
      
      * fix a sync problem related to copy cond argument from gpu to cpu
      
      * clang format
      
      * change the compile offload copy flag setting
      
      * clang format
      
      * enable copy from cpu to be able to do synchronous copy
      
      * clang format
      
      * add more unit tests
      
      * add more unit tests
      
      * add more ref unit tests
      
      * clang format
      
      * fixed a bug error
      
      * tmp code backup
      
      * clang format
      
      * fixed an onnx verify unit test
      
      * add more unit tests
      
      * clang format
      
      * reverse a change
      
      * fix cppcheck error
      
      * fix cppcheck error
      
      * fix to print all instructions in program execution
      
      * clang format
      
      * fix bugs related to memory coloring and offload copy to be true
      
      * clang format
      
      * remove unnecessary include header file
      
      * sort test cases in ref_cpu_ops alphabetically
      
      * clang format
      
      * add a flag to disable cpu target in verification test
      
      * change the way to disable some tests
      
      * clang format
      
      * disable verify unit test of the if operators
      
      * add a function call to have more code coverage
      
      * fix a build error
      
      * fix review comments
      
      * fix review comments
      
      * clang format
      
      * add a api gpu unit test for more code coverage
      
      * clang format
      
      * change to use instruction.size() as node index
      
      * move the calc_implicit_deps function to module class as a member function
      
      * clang format
      
      * move the offload_copy flag setting to lowering
      
      * clang format
      
      * assign the module_eval lambda function to a variable to simplify code
      
      * clang format
      
      * move the compute function from ref/gpu implementation to the main if operator
      
      * clang format
      
      * fix cpp check error
      
      * add a unit test for more code coverage
      
      * clang format
      
      * add unit test to calculate implicit deps
      
      * add a python unit test
      
      * clang format
      
      * refine a unit test to have more code coverage
      
      * clang format
      
      * chang the way of wrap up arguments for sub modules
      
      * clang format
      
      * fix some build errors
      
      * code cleanup
      
      * refine unit tests to have more code coverage
      
      * clang format
      
      * refine unit test to have more code coverage
      
      * code backup
      
      * clang format
      
      * add memory coloring test
      
      * refine memory coloring unit test
      
      * clang format
      
      * remove an unnecessary line
      
      * remove an unused line
      
      * remove an unnecessary parameter in the lambda function
      
      * clang format
      
      * refine a unit test
      
      * remove an unnecessary line
      
      * refine unit tests to have more code coverage
      
      * clang format
      
      * combine two lines
      
      * add one more unit test for more code coverage
      
      * clang format
      
      * add one more unit test
      
      * clang format
      
      * fix review comments
      
      * refine a print out information
      
      * fix review comments
      
      * clang format
      
      * change the sync copy to using a gpu device sync
      
      * clang format
      
      * remove unnecessary code
      Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
      41c0487b