x-deeplearning
An industrial deep learning framework for high-dimension sparse data
Top Related Projects
An Open Source Machine Learning Framework for Everyone
Tensors and Dynamic neural networks in Python with strong GPU acceleration
ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow
Quick Overview
X-DeepLearning (XDL) is an industrial deep learning framework developed by Alibaba. It is designed to support large-scale sparse data training and serving, with a focus on recommendation systems and search ranking. XDL aims to provide high performance and scalability for industrial-scale machine learning tasks.
Pros
- Optimized for large-scale sparse data processing
- Supports both training and serving of deep learning models
- Designed for industrial-scale recommendation and ranking tasks
- Integrates with popular deep learning frameworks like TensorFlow
Cons
- Limited documentation, especially in English
- Steep learning curve for users not familiar with Alibaba's ecosystem
- Less active community compared to more mainstream frameworks
- Primarily focused on specific use cases (recommendation and ranking)
Code Examples
import xdl
import xdl.python.ops.py_func as py_func
def custom_func(x):
return x * 2
result = py_func.py_func(custom_func, [input_tensor], [tf.float32])
This example demonstrates how to use a custom Python function within XDL.
import xdl
model = xdl.Model()
model.add(xdl.layers.Embedding(vocab_size, embedding_dim))
model.add(xdl.layers.FCLayer(hidden_units))
model.add(xdl.layers.FCLayer(1, activation='sigmoid'))
model.compile(optimizer='adam', loss='binary_crossentropy')
This code snippet shows how to create a simple neural network model using XDL's high-level API.
import xdl
reader = xdl.DataReader("hdfs://path/to/data")
reader.epochs(10)
reader.batch_size(1024)
for batch in reader.read():
features, labels = batch
loss = model.train(features, labels)
This example illustrates how to read data and train a model using XDL's data reading capabilities.
Getting Started
- Install XDL:
git clone https://github.com/alibaba/x-deeplearning.git
cd x-deeplearning
./build.sh
- Set up environment variables:
export PYTHONPATH=$PYTHONPATH:/path/to/x-deeplearning/xdl-python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/x-deeplearning/xdl/lib
- Run a simple example:
import xdl
# Your XDL code here
Note: Detailed installation and usage instructions may vary depending on your specific environment and requirements. Refer to the official documentation for more comprehensive guidance.
Competitor Comparisons
An Open Source Machine Learning Framework for Everyone
Pros of TensorFlow
- Larger community and ecosystem, with more resources, tutorials, and third-party libraries
- Better support for production deployment and serving models at scale
- More comprehensive documentation and official guides
Cons of TensorFlow
- Steeper learning curve, especially for beginners
- Can be more complex to set up and configure for specific use cases
- Slower development cycle compared to more lightweight frameworks
Code Comparison
X-DeepLearning:
import xdl
model = xdl.Model()
model.add(xdl.layers.Dense(64, activation='relu'))
model.add(xdl.layers.Dense(10, activation='softmax'))
model.compile(optimizer='adam', loss='categorical_crossentropy')
TensorFlow:
import tensorflow as tf
model = tf.keras.Sequential([
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
model.compile(optimizer='adam', loss='categorical_crossentropy')
Both frameworks offer similar high-level APIs for building neural networks, but TensorFlow's Keras API is more widely adopted and has more extensive documentation. X-DeepLearning may provide specific optimizations for Alibaba's infrastructure, but detailed information is limited due to its more niche usage.
Tensors and Dynamic neural networks in Python with strong GPU acceleration
Pros of PyTorch
- Larger community and ecosystem, with more resources and third-party libraries
- More flexible and dynamic computational graph, allowing for easier debugging
- Better support for research and prototyping due to its Pythonic nature
Cons of PyTorch
- Generally slower inference speed compared to X-DeepLearning
- Less optimized for large-scale distributed training scenarios
- Steeper learning curve for beginners due to its flexibility
Code Comparison
PyTorch:
import torch
x = torch.tensor([1, 2, 3])
y = torch.tensor([4, 5, 6])
z = x + y
print(z)
X-DeepLearning:
#include "ps-plus/common/tensor.h"
Tensor x({1, 2, 3});
Tensor y({4, 5, 6});
Tensor z = x + y;
std::cout << z << std::endl;
X-DeepLearning focuses on distributed training and inference optimization, while PyTorch offers a more flexible and user-friendly approach. PyTorch's dynamic graph construction allows for easier debugging and experimentation, making it popular in research. X-DeepLearning, developed by Alibaba, is designed for large-scale industrial applications with a focus on performance and scalability.
ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
Pros of ONNX Runtime
- Wider ecosystem support and compatibility with various frameworks
- More active development and frequent updates
- Extensive documentation and community resources
Cons of ONNX Runtime
- Potentially more complex setup for specific use cases
- May have higher resource requirements for certain operations
Code Comparison
ONNX Runtime:
import onnxruntime as ort
session = ort.InferenceSession("model.onnx")
input_name = session.get_inputs()[0].name
output = session.run(None, {input_name: input_data})
X-DeepLearning:
import xdl
model = xdl.Model("model.xdl")
output = model.predict(input_data)
Key Differences
- ONNX Runtime focuses on cross-platform compatibility and optimization
- X-DeepLearning is tailored for large-scale distributed training scenarios
- ONNX Runtime has broader language support (C++, Python, C#, etc.)
- X-DeepLearning emphasizes performance in Alibaba's cloud infrastructure
Use Cases
- ONNX Runtime: General-purpose inference across various platforms and frameworks
- X-DeepLearning: Specialized for large-scale distributed training and inference in Alibaba Cloud
Community and Support
- ONNX Runtime: Large, active community with regular updates and contributions
- X-DeepLearning: Smaller community, primarily supported by Alibaba
Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
Pros of MXNet
- Wider community support and adoption as an Apache project
- More extensive documentation and tutorials
- Better multi-GPU and distributed training capabilities
Cons of MXNet
- Steeper learning curve for beginners
- Less focus on industrial-scale deployment compared to X-DeepLearning
Code Comparison
MXNet example:
import mxnet as mx
data = mx.symbol.Variable('data')
fc1 = mx.symbol.FullyConnected(data, name='fc1', num_hidden=128)
act1 = mx.symbol.Activation(fc1, name='relu1', act_type="relu")
fc2 = mx.symbol.FullyConnected(act1, name='fc2', num_hidden=10)
mlp = mx.symbol.SoftmaxOutput(fc2, name='softmax')
X-DeepLearning example:
import xdl
data = xdl.data_io.input(name='data')
fc1 = xdl.fc_layer(data, 128, name='fc1')
act1 = xdl.relu_layer(fc1, name='relu1')
fc2 = xdl.fc_layer(act1, 10, name='fc2')
mlp = xdl.softmax_layer(fc2, name='softmax')
Both frameworks offer similar high-level APIs for building neural networks. MXNet provides a more symbolic approach, while X-DeepLearning focuses on a more imperative style. X-DeepLearning is designed for large-scale industrial applications, whereas MXNet offers a broader range of features for various use cases.
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
Pros of Horovod
- Wider adoption and community support
- Better integration with popular deep learning frameworks (TensorFlow, PyTorch, Keras)
- More extensive documentation and examples
Cons of Horovod
- Limited support for specialized hardware accelerators
- Less focus on large-scale distributed training scenarios
- Steeper learning curve for beginners
Code Comparison
X-DeepLearning:
import xdl
model = xdl.Model()
model.add(xdl.layers.Dense(64, activation='relu'))
model.add(xdl.layers.Dense(10, activation='softmax'))
model.compile(optimizer='adam', loss='categorical_crossentropy')
Horovod:
import horovod.tensorflow as hvd
hvd.init()
model = tf.keras.Sequential([
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
opt = tf.optimizers.Adam(lr=0.001 * hvd.size())
opt = hvd.DistributedOptimizer(opt)
model.compile(optimizer=opt, loss='categorical_crossentropy')
While both libraries aim to facilitate distributed deep learning, Horovod focuses on providing a unified interface for popular frameworks, whereas X-DeepLearning offers a more specialized solution for large-scale scenarios. Horovod's code is more framework-agnostic, while X-DeepLearning provides a custom API. The choice between the two depends on specific project requirements and existing infrastructure.
Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow
Pros of XGBoost
- Widely adopted and battle-tested in various industries
- Excellent performance on structured/tabular data
- Extensive documentation and community support
Cons of XGBoost
- Limited support for deep learning and neural network architectures
- Less suitable for unstructured data (images, text, etc.)
- May require more feature engineering compared to deep learning approaches
Code Comparison
XGBoost:
import xgboost as xgb
model = xgb.XGBClassifier()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
X-DeepLearning:
import xdl
model = xdl.model.Model(input, output)
model.compile(optimizer='adam', loss='binary_crossentropy')
model.train(train_data, epochs=10)
Key Differences
- XGBoost focuses on gradient boosting for structured data, while X-DeepLearning is designed for large-scale deep learning tasks
- XGBoost is more suitable for traditional machine learning problems, whereas X-DeepLearning targets complex neural network architectures
- XGBoost has a simpler API for quick implementation, while X-DeepLearning offers more flexibility for deep learning model customization
Use Cases
- XGBoost: Tabular data, predictive modeling, feature importance analysis
- X-DeepLearning: Large-scale deep learning, distributed training, complex neural network architectures
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
æ¦è¿°
X-DeepLearning(ç®ç§°XDL)æ¯é¢åé«ç»´ç¨çæ°æ®åºæ¯ï¼å¦å¹¿å/æ¨è/æç´¢çï¼æ·±åº¦ä¼åçä¸æ´å¥è§£å³æ¹æ¡ãXDL1.2çæ¬å·²äºè¿æåå¸ï¼ä¸»è¦ç¹æ§å æ¬ï¼
- é对大batch/ä½å¹¶ååºæ¯çæ§è½ä¼åï¼å¨æ¤ç±»åºæ¯ä¸æ§è½æå50-100%
- åå¨åéä¿¡ä¼åï¼åæ°æ é人工干é¢èªå¨å ¨å±åé ï¼è¯·æ±å并ï¼å½»åºæ¶é¤psç计ç®/åå¨/éä¿¡çç¹
- å®æ´çæµå¼è®ç»ç¹æ§ï¼å æ¬ç¹å¾åå ¥ï¼ç¹å¾æ·æ±°ï¼æ¨¡åå¢é导åºï¼ç¹å¾countingç»è®¡ç
- Fixäºè¥å¹²1.0ä¸çå°bugs
å®æ´ä»ç»è¯·åèXDL1.2 release note
1. XDLè®ç»å¼æ
2. XDLç®æ³è§£å³æ¹æ¡
3. Blazeé¢ä¼°å¼æ
4. 深度æ å¹é 模å TDM å¹é å¬åå¼æ
èç³»æ们
- 欢è¿éè¿issueåé®ä»¶ç»(xdl-opensource@list.alibaba-inc.com )èç³»æ们
- æ们æ£å¨å¯»æ±åä½ä¼ä¼´ï¼æå¿äºè·å¾XDLä¼ä¸çº§æ¯æ计åçå ¬å¸æå¢éï¼å¯ä»¥èç³»xdl-partner@list.alibaba-inc.comï¼ä¸æ们è¿ä¸æ¥åè°ã
FAQ
License
XDL使ç¨Apache-2.0许å¯
è´è°¢
XDL项ç®ç±é¿éå¦å¦äºä¸é¨è£èªåºåï¼æ ¸å¿è´¡ç®å¢éå æ¬é¿éå¦å¦å·¥ç¨å¹³å°ãç®æ³å¹³å°ãå®å广åææ¯å¢éãæ索广åææ¯å¢éçï¼åæ¶XDL项ç®ä¹å¾å°äºé¿é巴巴计ç®å¹³å°äºä¸é¨ï¼ç¹å«æ¯PAIå¢éï¼ç帮å©ã
Top Related Projects
An Open Source Machine Learning Framework for Everyone
Tensors and Dynamic neural networks in Python with strong GPU acceleration
ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot