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

supports non-list mdata #748

Merged
merged 2 commits into from
Jun 9, 2022
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Jun 8, 2022

The mdata of a task is a list of a single dict. This "list" looks useless and not clear enough. So this commit supports using the dict without a list.

Note that old parameters are still supported, so no breaking changes are made. The "list" is just removed from all examples. Both list and non-list parameters are in the unit test.

Old parameter:

"train": [
  {
    "command": "dp"
  }
]

New parameter:

"train": {
    "command": "dp"
  }

@njzjz njzjz requested a review from AnguseZhang June 8, 2022 03:43
@njzjz njzjz closed this Jun 8, 2022
@njzjz njzjz reopened this Jun 8, 2022
@njzjz njzjz marked this pull request as draft June 8, 2022 03:43
The mdata of a task is a list of a single dict. This "list" looks useless and not clear enough. So this commit supports using the dict without a list.

Note that old parameters are still supported, so no breaking changes are made. The "list" is just removed from all examples. Both list and non-list parameters are in the unittest.
@njzjz njzjz force-pushed the refactor-mdata branch from 0660142 to 94ffb1b Compare June 8, 2022 03:44
@njzjz njzjz marked this pull request as ready for review June 8, 2022 03:45
@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2022

Codecov Report

Merging #748 (be04fe6) into devel (b784351) will increase coverage by 0.49%.
The diff coverage is 69.60%.

@@            Coverage Diff             @@
##            devel     #748      +/-   ##
==========================================
+ Coverage   33.91%   34.40%   +0.49%     
==========================================
  Files          93       93              
  Lines       16562    16770     +208     
==========================================
+ Hits         5617     5770     +153     
- Misses      10945    11000      +55     
Impacted Files Coverage Δ
dpgen/generator/run.py 63.16% <69.26%> (+0.87%) ⬆️
dpgen/remote/decide_machine.py 92.00% <77.77%> (-8.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80f2cf7...be04fe6. Read the comment docs.

Copy link
Collaborator

@AnguseZhang AnguseZhang left a comment

Choose a reason for hiding this comment

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

I just explain why it's designed to be a list. Once I had three Slurm clusters, and tens of DP-GEN projects. So I want to make sure that DP-GEN submits its tasks to the most available (having most empty nodes or shortest waiting queue), and implement some detective functions in dispatcher. But it seems no one except me has this need, and so when we upgrade to dpdispatcher this function is deprecated.

@wanghan-iapcm wanghan-iapcm merged commit c25cea3 into deepmodeling:devel Jun 9, 2022
ZLI-afk pushed a commit to ZLI-afk/dpgen that referenced this pull request Jul 4, 2022
* supports non-list mdata

The mdata of a task is a list of a single dict. This "list" looks useless and not clear enough. So this commit supports using the dict without a list.

Note that old parameters are still supported, so no breaking changes are made. The "list" is just removed from all examples. Both list and non-list parameters are in the unittest.

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

Successfully merging this pull request may close these issues.

4 participants