CGCL-codes/naturalcc

NaturalCC: An Open-Source Toolkit for Code Intelligence

What it solves

NaturalCC is a sequence modeling toolkit that bridges the gap between programming languages and natural languages. It provides a unified framework for researchers and developers to build and evaluate models for software engineering tasks such as code generation, completion, summarization, retrieval, clone detection, and type inference.

How it works

Built on Fairseq's registry mechanism, the toolkit is modular and extensible. It integrates with Hugging Face Transformers to support large code models like Code Llama, CodeT5, CodeGen, and StarCoder. For training, it uses NCCL and torch.distributed for multi-GPU efficiency, supporting both FP32 and FP16 precision. It also includes preprocessing tools and scripts for feature extraction using compiler tools like LLVM.

Who it’s for

It is designed for AI researchers and software developers focusing on code intelligence and the intersection of machine learning and software engineering.

Highlights

  • Large Model Support: Integration with state-of-the-art models including Code Llama and StarCoder.
  • Comprehensive Datasets: Built-in support for benchmarks like Human-Eval, CodeSearchNet, and Py150.
  • Efficient Training: Optimized for multi-GPU setups with half-precision computation support.
  • Modular Architecture: Easy adaptation for custom models, criterions, and training procedures.

Related

  • Project
  • Dispatch
  • Dispatch
  • Project
  • Project