Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T transonic
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • fluiddyn
  • transonic
  • Issues
  • #40
Closed
Open
Created Feb 12, 2021 by Jingyang Wang@exenGT

Unexpected behavior of @jit and @boost

Recently I tested transonic with this simple code:

transonic_test.py

import numpy as np
from transonic import jit,boost

#transonic def norming(float[])

@boost
def norming(np_array):
    norm_array = np.linalg.norm(np_array, axis=1)
    return norm_array

I use this command to compile it ahead-of-time:

transonic transonic_test.py -af "-march=native -DUSE_XSIMD -Ofast"

which ran successfully. However, when I execute the following program

transonic_test_main.py

from transonic_test import *
from timeit import default_timer as timer

start_1 = timer()
for i in range(1000):
    in_arr = np.random.rand(10000, 3)
    norm_arr = norming(in_arr)
end_1 = timer()

print("time spent are {}".format(end_1 - start_1))

with python, the output shows:

DEBUG    Using rich for tracking progress.                                                                             
WARNING  Pythran file does not seem to be up-to-date:                                                                  
         <module '__pythran__.transonic_test_4f3187f787722cc89a00775cc0002503' from '/Users/jw598/Desktop/high_entropy_
         alloy/__pythran__/transonic_test_4f3187f787722cc89a00775cc0002503.cpython-37m-darwin.so'>                     
         func: norming                                                                                                 
time spent are 0.3765912619999999

with the timing almost the same as pure python. This problem is identical to the one reported here:
https://stackoverflow.com/questions/64857530/transonic-run-python-code-instead-of-pythran

My system configuration is:

OS: MacOS Catalina 10.15.7
gcc: 10.2.0
python: 3.7.7
pythran: 0.9.8.post2
transonic: 0.4.7.post0

Thanks a lot!

Jingyang Wang

Edited Feb 12, 2021 by Jingyang Wang
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking