Split the work across instances
Ask for several instances and each runs your script on its own share of the data. Every instance knows which one it is, so your code can pick its rows.
# submitted with instance_count=4
hosts = os.environ["SM_HOSTS"].split(",")
rank = hosts.index(os.environ["SM_CURRENT_HOST"])
my_rows = dataset[rank::len(hosts)]