-
Notifications
You must be signed in to change notification settings - Fork 137
Expose the available devices from the _ExecutionContext
.
#398
Conversation
In order for code to determine what sort of parallelism strategies make sense, we need to expose the list of available devices on the host. This change makes the list of available devices publicly readable. This change also orders the list of test suites alphabetically.
Thanks for the super fast review @rxwei ! PTAL? |
Could we instead make this return an array of public struct Device {
public let job: String?
public let replica: Int?
public let task: Int?
public let type: DeviceType
public let index: Int
}
public enum DeviceType {
case cpu, gpu, tpu
} This would be both more Swifty and also easier to manage on the user-side so that the user does not have to handle any string parsing, etc. |
We definitely could in the future, but note that ‘_ExecutionContext’ is itself not a public API (it’s underscored) and all of this is experimental. |
Does this api ultimately give way for functions like |
testCase(LazyTensorTests.allTests), | ||
testCase(LazyTensorTraceTests.allTests), | ||
testCase(LazyTensorExplicitTraceTests.allTests), | ||
testCase(LazyTensorOperationTests.allTests), | ||
testCase(LazyTensorTFFunctionBuilderTests.allTests), | ||
testCase(LazyTensorEvaluationTests.allTests), | ||
testCase(LossTests.allTests), |
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.
Usually good idea to keep unrelated changes in a separate PR?
In order for code to determine what sort of parallelism strategies make sense,
we need to expose the list of available devices on the host. This change makes
the list of available devices publicly readable.
This change also orders the list of test suites alphabetically.