Skip to content

Commit 6f4130b

Browse files
refactor: reorganiza estructura a core/ y ajusta empaquetado ttensor._ttensor
1 parent f9da9e0 commit 6f4130b

36 files changed

Lines changed: 419 additions & 13 deletions
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug report
3+
about: Reporta un fallo para ayudar a mejorar T-Tensor
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Resumen
10+
Describe el problema en 1-2 lineas.
11+
12+
## Pasos para reproducir
13+
1.
14+
2.
15+
3.
16+
17+
## Comportamiento esperado
18+
Que esperabas que pasara.
19+
20+
## Comportamiento actual
21+
Que paso realmente.
22+
23+
## Entorno
24+
- OS: Windows
25+
- Python:
26+
- CUDA Toolkit:
27+
- GPU:
28+
- Version de T-Tensor:
29+
30+
## Logs / trazas
31+
Pega aqui el error completo.
32+
33+
## Contexto extra
34+
Cualquier detalle adicional que ayude a reproducir.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Preguntas generales
4+
url: https://github.com/Gilberto-Galan/Mini-Framework-Deep-Learning-T-Tensor/discussions
5+
about: Para dudas de uso, abre una discusion.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Propone una mejora o nueva funcionalidad
4+
title: "[FEAT] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Resumen
10+
Describe la idea en 1-2 lineas.
11+
12+
## Problema que resuelve
13+
Que limitacion actual te afecta.
14+
15+
## Solucion propuesta
16+
Como te gustaria resolverlo.
17+
18+
## Alternativas consideradas
19+
Que otras opciones evaluaste.
20+
21+
## Impacto esperado
22+
Por que esta mejora vale la pena para la comunidad.
23+
24+
## Contexto extra
25+
Ejemplos, referencias o pseudo-codigo.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Resumen
2+
Describe brevemente que cambia este PR.
3+
4+
## Tipo de cambio
5+
- [ ] Bug fix
6+
- [ ] Nueva funcionalidad
7+
- [ ] Refactor
8+
- [ ] Documentacion
9+
- [ ] Rendimiento
10+
11+
## Como se probo
12+
Describe los pasos de prueba que ejecutaste.
13+
14+
## Checklist
15+
- [ ] Mi cambio es pequeno y enfocado
16+
- [ ] Actualice documentacion relevante
17+
- [ ] Verifique que el build siga funcionando
18+
- [ ] Agregue o actualice tests si aplica
19+
20+
## Notas para revision
21+
Comentarios que ayuden a revisar mas rapido.

.github/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GitHub
2+
3+
Esta carpeta se reserva para workflows de CI/CD y plantillas de Issues/PR.

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
quality:
11+
name: Quality Checks
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
22+
- name: Validate Python source syntax
23+
run: |
24+
python -m compileall ttensor examples tests
25+
26+
- name: Validate key project files
27+
run: |
28+
test -f CMakeLists.txt
29+
test -f pyproject.toml
30+
test -f setup.py
31+
test -f CONTRIBUTING.md
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Native Build (Self-Hosted CUDA)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-windows-cuda:
8+
name: Build On Self-Hosted Windows CUDA
9+
runs-on: [self-hosted, windows, cuda]
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Install build dependencies
20+
shell: pwsh
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install cmake pybind11 setuptools wheel
24+
25+
- name: Build and install package
26+
shell: pwsh
27+
run: |
28+
python -m pip install .
29+
30+
- name: Smoke import
31+
shell: pwsh
32+
run: |
33+
python -c "import ttensor; print('OK')"

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ── Compilación C++/CUDA ────────────────────────────────────────────
22
build/
3+
build-*/
34
bin/
45
Release/
56
Debug/
@@ -37,6 +38,7 @@ _deps/
3738

3839
# ── VS Code ──────────────────────────────────────────────────────────
3940
.vscode/
41+
.idea/
4042

4143
# ── Python ───────────────────────────────────────────────────────────
4244
__pycache__/
@@ -65,8 +67,14 @@ pip-wheel-metadata/
6567
# pytest / coverage
6668
.pytest_cache/
6769
.coverage
70+
.coverage.*
6871
htmlcov/
6972
.tox/
73+
.nox/
74+
75+
# type check / lint caches
76+
.mypy_cache/
77+
.ruff_cache/
7078

7179
# Build artifacts de python -m build
7280
*.whl
@@ -97,6 +105,7 @@ Desktop.ini
97105
*.bak
98106
*.swp
99107
*~
108+
import_err.txt
100109

101110
# ── Secretos / credenciales ──────────────────────────────────────────
102111
.env

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
cmake_minimum_required(VERSION 3.18)
22

3+
# Necesario para pasar el check de nvcc cuando MSVC es mas nuevo de lo soportado oficialmente.
4+
set(CMAKE_CUDA_FLAGS_INIT "-allow-unsupported-compiler")
5+
36
project(T_Tensor LANGUAGES CXX CUDA)
47

58
# --- CONFIGURACIÓN DE COMPILADOR ---
@@ -28,8 +31,8 @@ find_package(CUDAToolkit REQUIRED)
2831

2932
# 2. ARCHIVOS FUENTE
3033
# El core usa implementaciones CUDA (.cu)
31-
file(GLOB_RECURSE CORE_SOURCES "src/*.cu")
32-
set(BINDING_SOURCE "src/bindings.cpp")
34+
file(GLOB_RECURSE CORE_SOURCES "core/src/*.cu")
35+
set(BINDING_SOURCE "core/src/bindings.cpp")
3336

3437
# 3. LIBRERÍA CORE (STATIC)
3538
add_library(ttensor_core STATIC ${CORE_SOURCES})
@@ -41,7 +44,7 @@ set_target_properties(ttensor_core PROPERTIES
4144
)
4245

4346
target_include_directories(ttensor_core PUBLIC
44-
${CMAKE_CURRENT_SOURCE_DIR}/include
47+
${CMAKE_CURRENT_SOURCE_DIR}/core/include
4548
)
4649

4750
# Enlazamos curand a la librería core
@@ -62,7 +65,7 @@ target_link_libraries(ttensor_python PRIVATE
6265
set_target_properties(ttensor_python PROPERTIES
6366
CUDA_SEPARABLE_COMPILATION ON
6467
CUDA_RESOLVE_DEVICE_SYMBOLS ON
65-
OUTPUT_NAME "ttensor"
68+
OUTPUT_NAME "_ttensor"
6669
)
6770

6871
# 5. EJECUTABLE DE PRUEBA (C++)

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Para contribuir localmente, recomendamos este entorno:
2929
- Visual Studio Build Tools o Visual Studio con compilador MSVC C++
3030
- PowerShell (Windows)
3131

32+
Entorno recomendado de compilacion nativa en este repo:
33+
34+
- Visual Studio 18 2026 (x64)
35+
3236
Dependencias Python principales del proyecto:
3337

3438
- pybind11
@@ -63,6 +67,23 @@ python -c "import ttensor; print('OK')"
6367

6468
Si esto imprime `OK`, ya estás listo para contribuir.
6569

70+
## Verificación de compilación nativa (Visual Studio 18 2026)
71+
72+
Desde la raíz del proyecto:
73+
74+
```powershell
75+
cmake -S . -B build -G "Visual Studio 18 2026" -A x64 -DCMAKE_CUDA_FLAGS="--allow-unsupported-compiler" -Dpybind11_DIR="C:/Users/PC-R0O7/Desktop/T-Tensor/venv/Lib/site-packages/pybind11/share/cmake/pybind11"
76+
cmake --build build --config Release
77+
```
78+
79+
Pruebas rápidas después del build:
80+
81+
```powershell
82+
python -c "import ttensor; print('OK')"
83+
python examples/xor_cpu.py
84+
python -m unittest tests/test_import_smoke.py
85+
```
86+
6687
## Flujo recomendado para contribuir
6788

6889
1. Crea una rama para tu cambio.

0 commit comments

Comments
 (0)