-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
ts/nni_manager/common/nniConfig.ts
Outdated
} else { | ||
configPath = path.join(os.homedir(), '.config/nni', fileName); | ||
} | ||
return fs.readFileSync(configPath).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not consistent with the logic in nni.runtime.config
. What will happen in the case of conda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, I forgot.
|
||
export async function getCustomEnvironmentServiceConfig(name: string): Promise<CustomEnvironmentServiceConfig | null> { | ||
const configJson = await readConfigFile('training_services.json'); | ||
const config = JSON.parse(configJson); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try catch format error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is programmatically generated by NNI and this function is only invoked when user asks a custom training service.
So I prefer to just crash if the json file is broken.
@@ -32,9 +31,9 @@ export class OpenPaiEnvironmentService extends EnvironmentService { | |||
private experimentId: string; | |||
private config: FlattenOpenpaiConfig; | |||
|
|||
constructor(config: ExperimentConfig) { | |||
constructor(_experimentRootDir: string, experimentId: string, config: ExperimentConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pass rootDir and expId from constructor function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they are stored in "module scope objects" and custom training services cannot access them.
We must either (1) provide stateful API function to get experiment ID, (2) pass experiment ID through parameter.
According to the meeting last week, (2) is preferred by most people.
print_error('Bad experiment config class') | ||
return | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if user register an existed training service name? such as 'local' or 'aml'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's a problem, I'll push a fix.
Doc and example (template) will be added later.