eric-haibin-lin commented on a change in pull request #17555: [MXNET-#16795] Byteps-KVStore: Intergrate Byteps into mxnet as new type of kvstore backend URL: https://github.com/apache/incubator-mxnet/pull/17555#discussion_r376826321
########## File path: python/mxnet/kvstore/byteps.py ########## @@ -0,0 +1,210 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding: utf-8 +""" BytePS backend for MXNet KVStore""" +from __future__ import absolute_import + +from ..ndarray import NDArray +from .base import KVStoreBase + +__all__ = ['BytePS'] + + [email protected] +class BytePS(KVStoreBase): + """BytePS backend for MXNet KVStore interface.""" + + def __init__(self): + """Initializes a new KVStore.""" + try: + import byteps.mxnet as bps + self.handle = bps + except ImportError as err: + print('Did not find BytePS library. Please install BytePS first') + raise err + self.handle.init() + + def broadcast(self, key, value, out, priority=0): + """ Broadcast the value NDArray at rank 0 to all ranks' out. If out is None, + the result is stored in `value`. Review comment: newline before `Parameters`. Otherwise the doc does not render successfully. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
