Are you sure the __name__ == "__main__" is required and there’s no easy alternative to use here ? Maybe posting the actual could would help since there might be an easy way to modify it as to not require using set_start_method (E.g. by using DataParallel instead of mp)
That being said, there is a way to run code in a notebook as if it were ran under main:
exec(compile('your code here', '__main__.py', 'exec'))

Though I’m not sure if this will actually produce the expected behavior here and I don’t really have a multiple GPU machine handy right now to test.