We are excited to announce the official open-source release of Ring-flash-linear-2.0!
Building on the success of our Ling 2.0 series, this model continues to leverage a powerful hybrid architecture of linear and standard attention, perfectly balancing high performance with superior efficiency. By integrating our proven MoE design with optimizations like a 1/32 expert activation ratio and MTP layers, Ring-flash-linear achieves the performance of a 40B dense model while activating only 6.1B parameters. This model was converted from
Ling-flash-base-2.0
, further trained on an additional 1T tokens.
When it comes to benchmarks, Ring-flash-linear-2.0 not only holds its own against standard attention models (like Ring-flash-2.0) but also outperforms other open-source MoE and Dense models in its class on several demanding tasks. Plus, with support for a 128k long context, it's faster and more precise than ever, especially when handling long-form inputs and outputs.
Figure 1:
Hybrid Linear Model Architecture
Evaluation
To better demonstrate the model's capabilities, we selected representative open-source thinking models and closed-source APIs for comparison.
We present results on several challenging reasoning benchmarks spanning domains such as mathematics, coding, and science. Also, we evaluate the model's performance on a creative writing task (Creative Writing v3).
We observe that our model achieves performance on par with other models.
Figure 2:
Model Performance Comparison
Figure 3:
Model Performance Comparison
Linear Attention, Highly Sparse, High-Speed Generation
Thanks to its hybrid attention mechanism and highly sparse MoE architecture, Ring-flash-linear-2.0 achieves near-linear time complexity and constant space complexity, resulting in outstanding inference efficiency.
To fully demonstrate this advantage, we conducted a comparison between our model and top-tier competitors of similar size or performance.
The results clearly demonstrate the advantage of our model in inference efficiency.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "inclusionAI/Ring-flash-linear-2.0"
model = AutoModelForCausalLM.from_pretrained(
model_name,
dtype="auto",
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompts = [
"Give me a short introduction to large language models."
]
input_texts = []
for prompt in prompts:
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
input_texts.append(text)
print(input_texts)
model_inputs = tokenizer(input_texts, return_tensors="pt", return_token_type_ids=False, padding=True, padding_side='left').to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=8192,
do_sample=False,
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids inzip(model_inputs.input_ids, generated_ids)
]
responses = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
print("*" * 30)
print(responses)
print("*" * 30)
🚀 SGLang
Environment Preparation
We have submitted our
PR
to SGLang official release and it will be merged later, for now we can prepare the environment following steps, firstly install the community version SGLang and required packages:
BF16 and FP8 models are supported by SGLang now, it depends on the dtype of the model in ${MODEL_PATH}. They both share the same command in the following:
curl -s http://localhost:${PORT}/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "auto", "temperature": 0.6, "messages": [{"role": "user", "content": "Give me a short introduction to large language models."}]}'
Ring-flash-linear-2.0 huggingface.co is an AI model on huggingface.co that provides Ring-flash-linear-2.0's model effect (), which can be used instantly with this inclusionAI Ring-flash-linear-2.0 model. huggingface.co supports a free trial of the Ring-flash-linear-2.0 model, and also provides paid use of the Ring-flash-linear-2.0. Support call Ring-flash-linear-2.0 model through api, including Node.js, Python, http.
Ring-flash-linear-2.0 huggingface.co is an online trial and call api platform, which integrates Ring-flash-linear-2.0's modeling effects, including api services, and provides a free online trial of Ring-flash-linear-2.0, you can try Ring-flash-linear-2.0 online for free by clicking the link below.
inclusionAI Ring-flash-linear-2.0 online free url in huggingface.co:
Ring-flash-linear-2.0 is an open source model from GitHub that offers a free installation service, and any user can find Ring-flash-linear-2.0 on GitHub to install. At the same time, huggingface.co provides the effect of Ring-flash-linear-2.0 install, users can directly use Ring-flash-linear-2.0 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Ring-flash-linear-2.0 install url in huggingface.co: