You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/30 15:11:25 UTC

[GitHub] [tvm] wrongtest opened a new issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

wrongtest opened a new issue #10107:
URL: https://github.com/apache/tvm/issues/10107


   The result sampling dict is always {9: 12, 17: 11, 8: 16, 2: 14, -1: 10, 6: 15, 5: 11, -2: 11}
   
       def test_sample_compute_location():
           n = 100
           sch = tir.Schedule(tiled_conv2d_with_padding, seed=42, debug_mask="all")
           pad_input = sch.get_block("PadInput")
           decision_dict = dict()
           for _ in range(n):
               _ = sch.sample_compute_location(pad_input)  # pylint: disable=invalid-name
               decision = sch.trace.decisions[sch.trace.insts[-1]]
               decision_dict[decision] = decision_dict[decision] + 1 if decision in decision_dict else 1
   
           n_candidates = 8
           expected_rate = 1.0 / n_candidates
           for _, cnt in decision_dict.items():
   >           assert (expected_rate - 0.03) * n <= cnt <= (expected_rate + 0.03) * n
   E           assert 16 <= ((0.125 + 0.03) * 100)
   
   tests/python/unittest/test_tir_schedule_sampling.py:193: AssertionError
   ============================================================================================== short test summary info ===============================================================================================
   FAILED tests/python/unittest/test_tir_schedule_sampling.py::test_sample_compute_location - assert 16 <= ((0.125 + 0.03) * 100)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on issue #10107:
URL: https://github.com/apache/tvm/issues/10107#issuecomment-1025549487


   CC: @MasterJH5574 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] masahi closed issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
masahi closed issue #10107:
URL: https://github.com/apache/tvm/issues/10107


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on issue #10107:
URL: https://github.com/apache/tvm/issues/10107#issuecomment-1027510782


   That's good point! Thanks for pointing this out :-)
   
   @wrongtest so looks like our bound is probably too tight. Would you mind sending a PR tweaking it a little bit? Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] wrongtest commented on issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
wrongtest commented on issue #10107:
URL: https://github.com/apache/tvm/issues/10107#issuecomment-1026450840


   12, 11, 16, 14, 10, 15, 11, 11
   
   I'm not familiar with RNG issues but I find the implementation here:
   https://github.com/apache/tvm/blob/187aeb5fe813c5bffc81e88ba890399ce7d53e1e/src/tir/schedule/primitive/sampling.cc#L134-L135
   
   For `LinearCongruentialEngine` (Is it the PRNG generator mentioned by @junrushao1994?), the document of it says `It strictly corresponds to std::minstd_rand and is designed to be platform-independent`.
   
   For `uniform_int_distribution`, however, some guys say it is not platform-independent. https://stackoverflow.com/questions/26538627/c11-cross-compiler-standard-library-random-distribution-reproducibility


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] MasterJH5574 commented on issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on issue #10107:
URL: https://github.com/apache/tvm/issues/10107#issuecomment-1025956820


   > @MasterJH5574 it looks interesting given we already fixed the random seed, and we implemented our own PRNG - shouldn’t the result be deterministic then?
   
   Really? I don't know that the PRNG is absolutely deterministic with a given seed.
   
   Then I totally have no idea. On my machine the values of `cnt` are always always
   ```
   11
   14
   15
   13
   11
   13
   12
   11
   ```
   
   @wrongtest Would you mind pasting your output?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] MasterJH5574 commented on issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on issue #10107:
URL: https://github.com/apache/tvm/issues/10107#issuecomment-1025552932


   😨 I suggest setting a larger eps slightly. Looks like a same randomness seed behaves differently on different platforms...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on issue #10107: [Bug] test_tir_schedule_sampling.py:test_sample_compute_location can not pass on a M1 mac system

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on issue #10107:
URL: https://github.com/apache/tvm/issues/10107#issuecomment-1025944934


   @MasterJH5574 it looks interesting given we already fixed the random seed, and we implemented our own PRNG - shouldn’t the result be deterministic then? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org