Skip to content

Conversation

@tanmayv25
Copy link
Contributor

No description provided.

to/from the model in correct order irrespective of how they are
specified in `config.pbtxt`. The indices should be consecutive
integers starting from 0. Additionally, `--neuron-core-range`
provides the neuron cores to be used while serving these models.
Copy link
Contributor

Choose a reason for hiding this comment

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

specifies the neuron ...

Copy link
Contributor

Choose a reason for hiding this comment

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

@tanmayv25 how does the user specify non contiguous neuron cores?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't support that because I believe it is not important... The data parallel operations need to be contiguous to derive best performance from caching..

dt, shape = self.output_dict[name]
output_tensor = pb_utils.Tensor(name,
merged_result.astype(pb_utils.triton_string_to_numpy(dt)))
for i in range(len(self.output_dict)):
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an edge case where the outputs in model config can be ouput__0 and output__2 (1 is skipped). In this case range would not be a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use for i in self.output_dict? Similarly for input.
We do not care the order in which the outputs are read as long as they use the right index.

Copy link
Contributor Author

@tanmayv25 tanmayv25 Nov 10, 2021

Choose a reason for hiding this comment

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

We weed out the edge case in the validation logic in __validate_input_dict /validate_output_dict..
Basically, we don't support skipping of indices..

We do not care the order in which the outputs are read as long as they use the right index.

I think that is true.. I will fix it..

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically, we don't support skipping of indices..

Why do we want to skip it? The user should be allowed to ask for a subset of the outputs from the model, like with all other backends

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can not do this for inputs as the order does matter for placing the input in the list.

type=int,
default=4,
help='The number of available neuron cores')
parser.add_argument('--neuron_core_range',
Copy link
Contributor

Choose a reason for hiding this comment

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

We should set a default core range. Maybe just the first core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would want the user to be aware of this option and not silently introduce the limited executions..

@tanmayv25 tanmayv25 requested a review from CoderHam November 10, 2021 02:52
config_input['name'], config_input['data_type'],
config_input['dims']
]
expected_input_count = expected_input_count + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

+=?

self.input_dict[config_input['name']] = [
config_input['data_type'], config_input['dims']
index = self._validate_and_get_index(config_input['name'])
self.input_dict[index] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need a dict if index is used as key? List seems to be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to handle cases like INPUT__0 and INPUT__2, where INPUT__1 is missing. Using a dict helps in detecting missing indices with minimal iterations across input lists.

CoderHam
CoderHam previously approved these changes Nov 10, 2021
CoderHam
CoderHam previously approved these changes Nov 10, 2021
GuanLuo
GuanLuo previously approved these changes Nov 10, 2021

Additionally, `--neuron-core-range` specifies the neuron cores to
be used while serving this models. Currently, only
`torch.neuron.DataParallel()` mode is supported.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you specify what that means? Something like:

Currently, the core used is specified using `torch.neuron.DataParallel()`

@tanmayv25 tanmayv25 dismissed stale reviews from GuanLuo and CoderHam via e446860 November 10, 2021 22:36
Copy link
Contributor

@jbkyang-nvi jbkyang-nvi left a comment

Choose a reason for hiding this comment

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

lgtm. Small nit

@tanmayv25 tanmayv25 merged commit c387f6a into main Nov 11, 2021
@tanmayv25 tanmayv25 deleted the tanmayv-neuron-2.x branch November 11, 2021 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants