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

fix update document on PyTorch Neuron (“torch-neuronx”) Setup on Ubuntu #736

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/helperscripts/n2-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def install_neuron_driver(self, args):

if args.mode != 'compile':
# if args.ami != 'dlami-base':
install = 'install' if args.install_type == 'install' else 'update'
install = 'install' if args.install_type == 'install' else 'upgrade'
str += f'\n# {install} Neuron Driver\n'

if args.os == 'ubuntu18' or args.os == 'ubuntu20' or args.os == 'ubuntu22':
Expand All @@ -347,7 +347,10 @@ def install_neuron_driver(self, args):
'pin_major'].values[0] == 'true':
version = '=' + self.get_package_version(category='driver', name=driver_package,
neuron_version=args.neuron_version)
str += f'sudo apt-get {install} {driver_package}{version}* -y\n'
str += f'sudo apt-get {install} {driver_package}{version}* -y'
if args.install_type == 'update':
str += ' --allow-change-held-packages'
str += '\n'

elif args.os == 'amazonlinux2':
yum_install = 'install' if args.install_type == 'install' else 'update'
Expand Down Expand Up @@ -403,10 +406,16 @@ def install_neuron_runtime(self, args):
if args.neuron_version == None:
if self.df_package_properties.loc[self.df_package_properties['name'] == runtime_package][
'pin_major'].values[0] == 'true':
str += '=' + self.get_major_version(runtime_package, args.instance) + '.* -y\n'
str += '=' + self.get_major_version(runtime_package, args.instance) + '.* -y'
if args.install_type == 'update':
str += ' --allow-change-held-packages'
str += '\n'
elif (args.neuron_version != None) & (args.install_type == 'install'):
str += '=' + self.get_package_version(category='runtime', name=runtime_package,
neuron_version=args.neuron_version) + '* -y\n'
neuron_version=args.neuron_version) + '* -y'
if args.install_type == 'update':
str += ' --allow-change-held-packages'
str += '\n'
else:
str += '\n'

Expand Down Expand Up @@ -467,7 +476,10 @@ def install_neuron_system_tools(self, args):
if args.neuron_version == None:
if self.df_package_properties.loc[self.df_package_properties['name'] == system_tool][
'pin_major'].values[0] == 'true':
str += '=' + self.get_major_version(system_tool, args.instance) + '.* -y\n'
str += '=' + self.get_major_version(system_tool, args.instance) + '.* -y'
if args.install_type == 'update':
str += ' --allow-change-held-packages'
str += '\n'

elif (args.neuron_version != None) & (args.install_type == 'install'):
str += '=' + self.get_package_version(category='system-tools', name=system_tool,
Expand Down