Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Mitigate exponential complexity when running gpu_topology tests #13343

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

larroy
Copy link
Contributor

@larroy larroy commented Nov 20, 2018

Description

  • KL never succeeds so it always goes exponential
  • Too many weight matrices were rejected because of zero weights, simplify generation to not include 0 weight edges
    Mitigates MXNET_KVSTORE_USETREE problems #13341

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@stu1130
Copy link
Contributor

stu1130 commented Nov 20, 2018

@mxnet-label-bot add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Nov 20, 2018
@larroy larroy force-pushed the gpu_topo branch 2 times, most recently from 4900f7c to 9f6b9cd Compare November 20, 2018 18:57
@ctcyang
Copy link
Contributor

ctcyang commented Nov 20, 2018

LGTM, changing the test coverage from 16 to 8 should allow it finish much quicker.

@@ -67,15 +63,18 @@ bool IsSatisfactory(const std::vector<float>& W, int num_gpus, int depth) {
// Generates random link topology matrix using random number generator
void TestComputeTreesRandomized(int num_gpus, float alpha, int backtrack,
std::mt19937* gen) {
using namespace std;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need it if you are not using it

std::fill(W.begin(), W.end(), 0.f);
GenerateMatrix(&W, num_gpus, k, gen);
satisfied = IsSatisfactory(W, num_gpus, depth);
std::fill(W.begin(), W.end(), 0.f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to std::vector's constructor, the initialization is already done at line 69.

@@ -562,7 +561,7 @@ TEST(GpuTopology, TestComputeTrees1) {
float alpha = 0.7;
bool backtrack = true;
// Do 5 randomized tests per GPU count from 2 to 16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the comment from 16 to 8 as well

- KL never succeeds so it always goes exponential
- Too many weight matrices were rejected because of zero weights, simplify generation to not include 0 weight edges
satisfied = IsSatisfactory(W, num_gpus, depth);
GenerateMatrix(&W, num_gpus, gen);
satisfied = IsSatisfactory(W, num_gpus, depth);
if (mxnet::kvstore::kLogTree && !satisfied) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously it was trying multiple times - we want to stop doing it with this change?

Copy link
Contributor Author

@larroy larroy Nov 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's of no use. I also changed the distribution, is not relevant anymore and took a long time.

@marcoabreu marcoabreu merged commit dcd8950 into apache:master Nov 29, 2018
aaronmarkham pushed a commit to aaronmarkham/incubator-mxnet that referenced this pull request Nov 30, 2018
- KL never succeeds so it always goes exponential
- Too many weight matrices were rejected because of zero weights, simplify generation to not include 0 weight edges
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants