Skip to content

Rndv pipepline fails if the iface does not support put_zcopy #6836

Closed

Description

@SeyedMir

Describe the bug

This issue showed up in my tests with SRD which only supports get_zcopy, and not put_zcopy. But, I can also reproduce it with RC on an IB cluster by manually removing UCT_IFACE_FLAG_PUT_BCOPY and UCT_IFACE_FLAG_PUT_ZCOPY flags in uct_rc_iface_query.

# OSU MPI Multiple Bandwidth / Message Rate Test v5.6.3
# Send Buffer on DEVICE (D) and Receive Buffer on DEVICE (D)
# [ pairs: 1 ] [ window size: 64 ]
# Size                  MB/s        Messages/s
1                       0.03          31094.26
2                       0.06          30796.78
4                       0.12          30850.47
8                       0.25          30934.21
16                      0.49          30926.95
32                      0.99          30863.00
64                      1.87          29231.43
128                     3.89          30379.40
256                     7.90          30872.14
512                    15.77          30796.30
1024                   31.00          30273.87
2048                   62.42          30477.93
4096                  122.95          30017.96
8192                  241.39          29466.10
16384                 323.60          19750.98
rndv.c:1991 Assertion `!(rreq->flags & UCP_REQUEST_FLAG_RNDV_FRAG)' failed

As far as I could figure out, a received rndv data can correspond to a frag RTR, so I'm not sure why we have that assertion. However, removing it resulted in further assertion failures. For instance, after applying the following changes

diff --git a/src/ucp/rndv/rndv.c b/src/ucp/rndv/rndv.c
index 84aacc12d..e3a59be42 100644
--- a/src/ucp/rndv/rndv.c
+++ b/src/ucp/rndv/rndv.c
@@ -1156,7 +1156,7 @@ static void ucp_rndv_send_frag_rtr(ucp_worker_h worker, ucp_request_t *rndv_req,
         freq->recv.length                 = frag_size;
         freq->recv.state.dt.contig.md_map = 0;
         freq->recv.frag.offset            = offset;
-        freq->flags                       = UCP_REQUEST_FLAG_RNDV_FRAG;
+        freq->flags                       = UCP_REQUEST_FLAG_RNDV_FRAG | UCP_REQUEST_FLAG_RECV_TAG;

         ucp_request_set_super(freq, rreq);

@@ -1988,7 +1988,6 @@ UCS_PROFILE_FUNC(ucs_status_t, ucp_rndv_data_handler,

     rreq = ucp_request_get_super(rndv_req);
     ucs_assert(rreq != NULL);
-    ucs_assert(!(rreq->flags & UCP_REQUEST_FLAG_RNDV_FRAG));
     ucs_assert(rreq->flags &
                (UCP_REQUEST_FLAG_RECV_AM | UCP_REQUEST_FLAG_RECV_TAG));

I got to the failure below:

ucp_request.inl:747  Assertion `req->recv.remaining >= length' failed: req->recv.remaining=0 length=8238

Steps to Reproduce

  • mpirun -n 2 --hostfile ~/hostfile --mca pml ucx --mca opal_common_ucx_tls any --mca opal_common_ucx_devices any -x UCX_TLS=rc,cuda_copy,cuda_ipc,self -x UCX_IB_GPU_DIRECT_RDMA=n ./osu_mbw_mr D D
  • UCT version=1.11.0 revision 2175333

Activity

  1. bureddy commented on May 21, 2021

    @bureddy
    Contributor

    @SeyedMir PUT_ZCOPY is must for existing pipeline protocols.

  2. dmitrygx commented on May 21, 2021

    @dmitrygx
    Member

    @SeyedMir PUT_ZCOPY is must for existing pipeline protocols.

    @bureddy shall we support RNDV over AM for pipeline protocols? or somehow show that sender doesn't support PUT_ZCOPY when sending RTS?

  3. dmitrygx commented on May 28, 2021

    @dmitrygx
    Member

    @SeyedMir could you check if #6870 fixes the issue?

  4. SeyedMir commented on Jun 1, 2021

    @SeyedMir
    ContributorAuthor

    @dmitrygx It still fails, but for a different assertion. Like before, it works fine if the RC iface has PUT_ZCOPY/PUT_BCOPY caps. But, it fails when I remove PUT_ZCOPY/PUT_BCOPY.

    # OSU MPI Multiple Bandwidth / Message Rate Test v5.6.3
    # Send Buffer on DEVICE (D) and Receive Buffer on DEVICE (D)
    # [ pairs: 1 ] [ window size: 64 ]
    # Size                  MB/s        Messages/s
    1                       0.10         104140.56
    2                       0.21         104275.90
    4                       0.42         104235.43
    8                       0.83         104003.36
    16                      1.66         103650.62
    32                      3.26         101763.94
    64                      6.44         100563.54
    128                    13.10         102310.62
    256                    26.14         102100.30
    512                    52.25         102051.67
    1024                  103.97         101529.46
    2048                  205.24         100216.13
    4096                  403.14          98422.99
    8192                  775.62          94679.81
    16384                 798.10          48711.95
    32768                 805.58          24584.25
    65536                 819.15          12499.31
    131072                824.48           6290.27
    262144                825.40           3148.64
    524288                828.70           1580.63
    [prm-dgx-29:18735:0:18735] ucp_request.inl:757  Assertion `req->recv.remaining >= length' failed: req->recv.remaining=5294 length=8238
    ==== backtrace (tid:  18735) ====
     0  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_handle_error+0x264) [0x7f4bc1401f14]
     1  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_fatal_error_message+0xb9) [0x7f4bc13fe829]
     2  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_fatal_error_format+0xd6) [0x7f4bc13fe906]
     3  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_rndv_data_handler+0x90e) [0x7f4bc14cbabe]
     4  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/ucx/libuct_ib.so.0(+0x5326a) [0x7f4bbf88c26a]
     5  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_worker_progress+0x7a) [0x7f4bc148a21a]
     6  /gpfs/fs1/hmirsadeghi/repos/ompi/_build/lib/libopen-pal.so.0(opal_progress+0x2c) [0x7f4bc489aefc]
     7  /gpfs/fs1/hmirsadeghi/repos/ompi/_build/lib/libmpi.so.0(ompi_request_default_wait_all+0x255) [0x7f4bc2b8c805]
     8  /gpfs/fs1/hmirsadeghi/repos/ompi/_build/lib/libmpi.so.0(PMPI_Waitall+0x2f) [0x7f4bc2be1fcf]
     9  /gpfs/fs1/hmirsadeghi/packages/osu-micro-benchmarks-5.6.3/_build/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_mbw_mr() [0x402b86]
    10  /gpfs/fs1/hmirsadeghi/packages/osu-micro-benchmarks-5.6.3/_build/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_mbw_mr() [0x402411]
    11  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f4bc1bb2bf7]
    12  /gpfs/fs1/hmirsadeghi/packages/osu-micro-benchmarks-5.6.3/_build/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_mbw_mr() [0x40280a]
    =================================
    [prm-dgx-29:18735:0:18735] Process frozen...
    [prm-dgx-28:76852:0:76852] ucp_request.inl:927  Assertion `(*req_p)->id == (id)' failed: req=0xff8640 req->id=0x0 id=0xff8640
    ==== backtrace (tid:  76852) ====
     0  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_handle_error+0x264) [0x7f89eabe1f14]
     1  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_fatal_error_message+0xb9) [0x7f89eabde829]
     2  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_fatal_error_format+0xd6) [0x7f89eabde906]
     3  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_rndv_rtr_handler+0x73d) [0x7f89eacf7ecd]
     4  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/ucx/libuct_ib.so.0(+0x5326a) [0x7f89e8e5926a]
     5  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_worker_progress+0x7a) [0x7f89eacb721a]
     6  /gpfs/fs1/hmirsadeghi/repos/ompi/_build/lib/libopen-pal.so.0(opal_progress+0x2c) [0x7f89eadccefc]
     7  /gpfs/fs1/hmirsadeghi/repos/ompi/_build/lib/libmpi.so.0(ompi_request_default_wait_all+0x255) [0x7f89ebf6f805]
     8  /gpfs/fs1/hmirsadeghi/repos/ompi/_build/lib/libmpi.so.0(PMPI_Waitall+0x2f) [0x7f89ebfc4fcf]
     9  /gpfs/fs1/hmirsadeghi/packages/osu-micro-benchmarks-5.6.3/_build/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_mbw_mr() [0x402a0f]
    10  /gpfs/fs1/hmirsadeghi/packages/osu-micro-benchmarks-5.6.3/_build/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_mbw_mr() [0x402411]
    11  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f89eb536bf7]
    12  /gpfs/fs1/hmirsadeghi/packages/osu-micro-benchmarks-5.6.3/_build/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_mbw_mr() [0x40280a]
    
  5. dmitrygx commented on Jun 1, 2021

    @dmitrygx
    Member

    @SeyedMir thanks for checking!
    we decided to change the implementation by just disabling PUT Zcopy pipeline protocol if it is not supported - see #6881
    could you test it on your setup, please?

  6. SeyedMir commented on Jun 1, 2021

    @SeyedMir
    ContributorAuthor

    @dmitrygx testing with #6881

    # OSU MPI Multiple Bandwidth / Message Rate Test v5.6.3
    # Send Buffer on DEVICE (D) and Receive Buffer on DEVICE (D)
    # [ pairs: 1 ] [ window size: 64 ]
    # Size                  MB/s        Messages/s
    1                       0.10         101663.25
    2                       0.21         106041.85
    4                       0.43         107614.03
    8                       0.86         107583.35
    16                      1.71         107147.69
    32                      3.37         105432.28
    64                      6.70         104715.81
    128                    13.58         106129.86
    256                    27.06         105705.42
    512                    54.00         105475.91
    1024                  106.24         103747.99
    2048                  206.31         100739.08
    4096                  395.46          96547.34
    8192                  762.48          93075.79
    16384                 789.02          48158.26
    [prm-dgx-11:52299:0:52299] ucp_request.inl:945  Assertion `!(req->flags & UCP_REQUEST_FLAG_SUPER_VALID)' failed: req=0x2cb8680 req->super_req=0x2cb8840
    ==== backtrace (tid:  52299) ====
     0  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_handle_error+0x264) [0x7f91c18b50f4]
     1  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_fatal_error_message+0xb9) [0x7f91c18b19f9]
     2  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucs.so.0(ucs_fatal_error_format+0xd6) [0x7f91c18b1ad6]
     3  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(+0x810d2) [0x7f91c19740d2]
     4  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_rndv_receive+0x19b1) [0x7f91c1978241]
     5  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_tag_rndv_process_rts+0x1e9) [0x7f91c199b7b9]
     6  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_rndv_rts_handler+0x4e) [0x7f91c19784be]
     7  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/ucx/libuct_ib.so.0(+0x53aea) [0x7f91bfd3eaea]
     8  /gpfs/fs1/hmirsadeghi/repos/ucx/_build/lib/libucp.so.0(ucp_worker_progress+0x7a) [0x7f91c193e0fa]
    
  7. dmitrygx commented on Jun 1, 2021

    @dmitrygx
    Member

    @SeyedMir thanks for checking it! Unfortunately, the fix was incomplete.
    I managed to reproduce the issue in UCP gtests. Now we have stable reproducer for the problem in UCX testing.
    @bureddy helped me to understand and fix what leads to the last issue. thanks @bureddy!

    @SeyedMir could you check the changes from #6881 PR again, please?

  8. SeyedMir commented on Jun 2, 2021

    @SeyedMir
    ContributorAuthor

    @dmitrygx it is working fine now

  9. dmitrygx commented on Jun 2, 2021

    @dmitrygx
    Member

    @dmitrygx it is working fine now

    @SeyedMir thanks for the testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions